-
Notifications
You must be signed in to change notification settings - Fork 10
86 lines (86 loc) · 3.12 KB
/
analysis.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Analysis
on:
pull_request: {}
push:
branches: [develop, main]
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
cache: "yarn"
node-version-file: ".node-version"
- name: Install deps
run: yarn install --frozen-lockfile
- name: Lint
run: "yarn run lint"
- name: Check formatting
run: "yarn run prettier:check"
test:
name: "Unit test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
cache: "yarn"
node-version-file: ".node-version"
- name: Install deps
run: yarn install --frozen-lockfile
- name: Test
run: "yarn run test --coverage"
- name: Upload Artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: coverage
path: |
coverage
!coverage/lcov-report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
e2e:
name: "Test end-to-end"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
cache: "yarn"
node-version-file: ".node-version"
- name: Install deps
run: yarn install --frozen-lockfile
- name: Build Storybook
run: yarn build-storybook
- name: Get Playwright version
run: |
echo -n "Chromium version: "
~/.cache/ms-playwright/chromium-1140/chrome-linux/chrome --version
echo "PLAYWRIGHT_VERSION=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_ENV
- name: Cache Playwright binaries
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright binaries
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- name: Run Playwright tests
# We use this action to get a virtual frame buffer for the browsers
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
with:
run: yarn playwright test -j 100%
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14