-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (90 loc) · 3.36 KB
/
ci.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
87
88
89
90
91
92
93
name: Lint, Build, and Test Bitauth IDE
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn install --immutable --immutable-cache
- run: yarn test:lint
e2e-tests:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.41.0-jammy
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
shardTotal: [8]
environment: ['dev', 'prod']
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
# The "preinstall" script runs "git submodule update --init --recursive"
# to avoid requiring users to understand this project's submodules
# configuration. Since the files are owned by a different user than the
# GitHub Action runner (a quirk of GitHub Actions), updating the
# submodules again would error: `fatal: detected dubious ownership in repository at '/__w/bitauth-ide/bitauth-ide'`
# We can safely disable this check for CI.
run: git config --global --add safe.directory '*' && yarn install --immutable --immutable-cache
- name: Test development build
run: yarn test:e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
if: ${{ matrix.environment == 'dev' }}
env:
HOME: /root # https://github.com/microsoft/playwright/issues/6500
- name: Test production build
run: yarn build && yarn test:e2e:prod --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
if: ${{ matrix.environment == 'prod' }}
env:
HOME: /root # https://github.com/microsoft/playwright/issues/6500
- uses: actions/upload-artifact@v4
if: ${{ matrix.environment == 'prod' && matrix.shardIndex == 1 }}
with:
name: dist
path: dist/
retention-days: 90
- uses: actions/upload-artifact@v4
if: always()
with:
name: blob-report-${{ matrix.environment }}-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
- uses: codecov/codecov-action@v3
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: always()
needs: [e2e-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: git config --global --add safe.directory '*' && yarn install --immutable --immutable-cache
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: yarn playwright merge-reports --reporter html,github ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 90