Skip to content

Commit

Permalink
CI Patch 1
Browse files Browse the repository at this point in the history
chore: checl if ci takes node from file
  • Loading branch information
a0v0 authored Aug 20, 2024
2 parents 9a220c2 + 2631db6 commit b404cfd
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 145 deletions.
80 changes: 24 additions & 56 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,46 @@ on:

jobs:
build_and_test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
node_version:
# - 18
- 20
# - 22
architecture:
- x64
name: E2E tests with node@${{ matrix.node_version }} on ${{ matrix.os }} - ${{ matrix.architecture }}
node_version: [20]

name: E2E tests with node@${{ matrix.node_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
# - uses: pnpm/action-setup@v4
# name: Install pnpm
# with:
# version: 9
- uses: wyvox/action-setup-pnpm@v3

- uses: actions/cache@v4
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.pnpm-store
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node_version }}
# architecture: ${{ matrix.architecture }}
# cache: "pnpm"
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# - name: Get pnpm store directory
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

# - uses: actions/cache@v4
# name: Setup pnpm cache
# with:
# path: ${{ env.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-

# - name: Set SENTRY_AUTH_TOKEN env if secret exists
# run: |
# if [[ -n "${{ secrets.SENTRY_AUTH_TOKEN }}" ]]; then
# echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> $GITHUB_ENV
# fi

- name: Build Next.js for E2E tests
run: pnpm build

# TODO: Add commitlint to PRs
# - if: github.event_name == 'pull_request'
# name: Validate all commits from PR
# run: pnpx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

# - name: Linter
# run: pnpm lint

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v3
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Install Playwright (used for Storybook and E2E tests)
run: npx playwright install --with-deps

# - name: Run storybook tests
# run: pnpm run test-storybook:ci
- name: Run E2E tests
run: pnpm run test:e2e
# env:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/checkly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test-e2e:
strategy:
matrix:
node-version: [20.x]
node-version: [20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

if: github.event.deployment_status.state == 'success' # Only run when the deployment was successful.
Expand All @@ -30,10 +30,9 @@ jobs:
- name: Set branch name # workaround to detect branch name in "deployment_status" actions
run: echo "CHECKLY_TEST_REPO_BRANCH=$(git show -s --pretty=%D HEAD | tr -s ',' '\n' | sed 's/^ //' | grep -e 'origin/' | head -1 | sed 's/\origin\///g')" >> $GITHUB_ENV

- uses: actions/setup-node@v3
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Restore or cache node_modules
id: cache-node-modules
Expand All @@ -44,11 +43,11 @@ jobs:

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
run: pnpm i

- name: Run checks # run the checks passing in the ENVIRONMENT_URL and recording a test session.
id: run-checks
run: npx checkly test -e ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL }} --reporter=github --record
run: pnpx checkly test -e ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL }} --reporter=github --record

- name: Create summary # export the markdown report to the job summary.
id: create-summary
Expand All @@ -57,4 +56,4 @@ jobs:
- name: Deploy checks # if the test run was successful and we are on Production, deploy the checks
id: deploy-checks
if: steps.run-checks.outcome == 'success' && github.event.deployment_status.environment == 'Production'
run: npx checkly deploy --force
run: pnpx checkly deploy --force
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release:
strategy:
matrix:
node-version: [20.x]
node_version: [20]

name: Create a new release
runs-on: ubuntu-latest
Expand All @@ -23,14 +23,16 @@ jobs:
pull-requests: write # to be able to comment on released pull requests

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
node-version: ${{ matrix.node_version }}


- run: HUSKY=0 npm ci

- name: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vercel.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Production Tag Deployment
name: Vercel Deploymnet
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
Expand Down
8 changes: 4 additions & 4 deletions checkly.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { defineConfig } from "checkly";
import { EmailAlertChannel, Frequency } from "checkly/constructs";

const emailChannel = new EmailAlertChannel("email-channel-1", {
address: "",
address: process.env.CHECKLY_EMAIL_ADDRESS ?? "",
sendDegraded: true,
});

export const config = defineConfig({
projectName: "Next.js Boilerplate",
logicalId: "nextjs-boilerplate",
repoUrl: "https://github.com/ixartz/Next-js-Boilerplate",
projectName: "aVToolz",
logicalId: "avtoolz",
repoUrl: "https://github.com/a0v0/avtoolz",
checks: {
locations: ["us-east-1", "eu-west-1"],
tags: ["website"],
Expand Down
70 changes: 0 additions & 70 deletions src/locales/fr.json

This file was deleted.

3 changes: 1 addition & 2 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ TODO: update `README.md` as per https://github.com/lobehub/sd-webui-lobe-theme
TODO: add github social preview banner
TODO: ability to rotate selected images
TODO: add total pages count in pdf

TODO: replace eng string with i18n string
TODO: add proper seo meta tags to pages

0 comments on commit b404cfd

Please sign in to comment.