-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (68 loc) · 2.14 KB
/
snap.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
name: Snap
env:
CI: true
FORCE_COLOR: 1
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/ms-playwright
on:
push:
branches:
- master
paths:
- 'packages/snap/**'
- '.github/workflows/snap.yml'
- 'pnpm-lock.yaml'
pull_request:
paths:
- 'packages/snap/**'
- '.github/workflows/snap.yml'
- 'pnpm-lock.yaml'
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- run: pnpm --filter filsnap exec playwright install --with-deps chromium
- run: pnpm -r --filter filsnap run lint
- run: pnpm -r --filter filsnap exec depcheck
- run: pnpm -r --filter filsnap run test:unit
- run: pnpm -r --filter filsnap run test:e2e
id: tests
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: packages/snap/playwright-report/
retention-days: 30
- name: Check for playwright-report
id: check_report
if: always()
uses: andstor/file-existence-action@v2
with:
files: packages/snap/playwright-report
- name: Add report to web3.storage
if: always() && steps.check_report.outputs.files_exists == 'true' && steps.tests.outcome != 'success'
uses: web3-storage/add-to-web3@v2
id: add_to_web3_storage
with:
path_to_add: packages/snap/playwright-report
web3_token: ${{ secrets.WEB3_TOKEN }}
- name: Add url to GITHUB_STEP_SUMMARY
if: always() && steps.check_report.outputs.files_exists == 'true' && steps.tests.outcome != 'success'
run: |
echo "
### Snap Tests failed 🤷🏻♂️
Check report and traces: https://w3s.link/ipfs/${{ steps.add_to_web3_storage.outputs.cid }}
" >> $GITHUB_STEP_SUMMARY