-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (66 loc) · 2.22 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Quality Control
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
qc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
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: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npx playwright -V | awk '{ print $2 }')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- name: Check format
run: yarn format
- name: Check lint
run: yarn lint:ci
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
- name: Build all projects
run: yarn build
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
- name: Check if there are changes
uses: NathanielHill/[email protected]
- name: Test all projects
id: test_projects
run: yarn test
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
- name: Upload playwright trace
if: ${{ failure() && steps.test_projects.conclusion == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: playwright-traces
path: dist/.playwright/packages/storybook/test-output
- 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: qc
uses: ./.github/workflows/deploy-unicorn.yml