Skip to content

Commit

Permalink
ci: merge ci steps into one qc step
Browse files Browse the repository at this point in the history
  • Loading branch information
janivo committed Dec 5, 2023
1 parent 28e82f7 commit 3ba61af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-example-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy Example Projects

on:
workflow_run:
workflows: [ "Test & Build" ]
workflows: [ "Quality Control" ]
types: [completed]
branches: [master]

Expand Down
63 changes: 20 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test & Build
name: Quality Control

on:
push:
Expand All @@ -8,55 +8,32 @@ on:
types: [opened, synchronize, reopened]

jobs:
build_core:
qc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/dependencies-install
- run: yarn nx run-many --target=build --projects=elements* --exclude=*-example
# Build caches for (canary) release workflow
- if: github.ref == 'refs/heads/master'
name: Upload build artifacts for canary release
uses: ./.github/workflows/artifacts-upload
- name: Checkout repository
uses: actions/checkout@v4
with:
upload-core-artifacts: true

lint_n_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/dependencies-install
- run: yarn lint
- run: yarn format

test:
needs:
- build_core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/dependencies-install
- run: yarn build:core
- run: yarn test

build_dependent:
runs-on: ubuntu-latest
needs:
- build_core
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/dependencies-install
- run: yarn nx run-many --target=build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
fetch-depth: 0
- name: Track master branch to make nx affected work
run: git branch --track main origin/master
- name: Install dependencies
uses: ./.github/workflows/dependencies-install
- name: Check format
run: yarn format
- name: Check lint
run: yarn lint
- name: Build all projects
run: yarn build
- name: Test all projects
run: yarn test
- name: Upload build artifacts for canary release
uses: ./.github/workflows/artifacts-upload
with:
upload-core-artifacts: true
upload-example-artifacts: ${{ github.ref == 'refs/heads/master' }}
upload-storybook-artifact: true

unicorn:
needs:
- test
- build_dependent
needs: qc
uses: ./.github/workflows/deploy-unicorn.yml

0 comments on commit 3ba61af

Please sign in to comment.