From 72f575ccd1b1a8cceff1be3a56b028c0f2f5ecbc Mon Sep 17 00:00:00 2001 From: Mumtahin Farabi Date: Mon, 23 Sep 2024 12:43:58 -0400 Subject: [PATCH] ci: split up jobs into separate pipelines --- .github/workflows/{CI.yml => BUILD.yml} | 25 +------------- .github/workflows/RELEASE.yml | 42 ++++++++++++++++++++++++ .github/workflows/TEST_E2E.yml | 43 +++++++++++++++++++++++++ .github/workflows/TEST_VISUAL.yml | 40 +++++++++++++++++++++++ release.config.ts | 1 + 5 files changed, 127 insertions(+), 24 deletions(-) rename .github/workflows/{CI.yml => BUILD.yml} (59%) create mode 100644 .github/workflows/RELEASE.yml create mode 100644 .github/workflows/TEST_E2E.yml create mode 100644 .github/workflows/TEST_VISUAL.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/BUILD.yml similarity index 59% rename from .github/workflows/CI.yml rename to .github/workflows/BUILD.yml index d74c0e0..fb4c49c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/BUILD.yml @@ -1,4 +1,4 @@ -name: CI +name: Build on: push: @@ -36,32 +36,9 @@ jobs: - name: ๐Ÿง Check Code Quality run: pnpm lint - # - name: ๐ŸŽญ Install Playwright - # run: pnpm i playwright http-server wait-on; npx playwright install --with-deps - - name: ๐Ÿ“” Build Storybook run: pnpm build-storybook --quiet - # - name: ๐Ÿงช Serve Storybook and run tests - # run: | - # pnpx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ - # "pnpm exec http-server storybook-static --port 6006 --silent" \ - # "pnpm exec wait-on tcp:6006 && pnpm test-storybook" - - # - name: ๐Ÿ”ฌ Run Unit Tests - # run: pnpm jest ... - - # - name: ๐Ÿ” Run Integration Tests - # run: pnpm jest ... - - # - name: โŒš ๐Ÿ’€ Run E2E Tests - # run: pnpx playwright test - - - name: ๐Ÿ‘€ Run Visual Tests - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - run: pnpm chromatic - - name: ๐Ÿ—๏ธ Build Project # env: # SANITY_API_READ_TOKEN: ${{ secrets.SANITY_API_READ_TOKEN }} diff --git a/.github/workflows/RELEASE.yml b/.github/workflows/RELEASE.yml new file mode 100644 index 0000000..291cc98 --- /dev/null +++ b/.github/workflows/RELEASE.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: ๐Ÿ›Ž๏ธ Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # All history for branches and tags + + - name: ๐Ÿ“ฆ Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ› ๏ธ Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + cache: pnpm + + - name: ๐Ÿ“‚ Install Dependencies + run: pnpm i + + - name: ๐Ÿค– Run Semantic Release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: pnpm exec semantic-release + + - name: ๐Ÿ’ฐ Profit + run: echo ๐Ÿž diff --git a/.github/workflows/TEST_E2E.yml b/.github/workflows/TEST_E2E.yml new file mode 100644 index 0000000..2418955 --- /dev/null +++ b/.github/workflows/TEST_E2E.yml @@ -0,0 +1,43 @@ +name: End-to-End Tests + +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: ๐Ÿ›Ž๏ธ Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # All history for branches and tags + + - name: ๐Ÿ“ฆ Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ› ๏ธ Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + cache: pnpm + + - name: ๐Ÿ“‚ Install Dependencies + run: pnpm i + + - name: ๐Ÿง Check Code Quality + run: pnpm lint + + # - name: ๐ŸŽญ Install Playwright + # run: pnpm i playwright http-server wait-on; npx playwright install --with-deps + + - name: ๐Ÿ’ฐ Profit + run: echo ๐Ÿž diff --git a/.github/workflows/TEST_VISUAL.yml b/.github/workflows/TEST_VISUAL.yml new file mode 100644 index 0000000..b65a11a --- /dev/null +++ b/.github/workflows/TEST_VISUAL.yml @@ -0,0 +1,40 @@ +name: Visual Tests + +on: + push: + branches: main + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + + steps: + - name: ๐Ÿ›Ž๏ธ Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # All history for branches and tags + + - name: ๐Ÿ“ฆ Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ› ๏ธ Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: '${{ matrix.node-version }}' + cache: pnpm + + - name: ๐Ÿ“‚ Install Dependencies + run: pnpm i + + - name: ๐Ÿ‘€ Run Visual Tests + env: + CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + run: pnpm chromatic + + - name: ๐Ÿ’ฐ Profit + run: echo ๐Ÿž diff --git a/release.config.ts b/release.config.ts index 13206c3..27b62b2 100644 --- a/release.config.ts +++ b/release.config.ts @@ -2,6 +2,7 @@ import type { GlobalConfig } from 'semantic-release' const config: Partial = { branches: ['main'], + repositoryUrl: 'https://github.com/ieee-spac/2024', } export default config