-
Notifications
You must be signed in to change notification settings - Fork 7
103 lines (103 loc) · 3.68 KB
/
tests.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
94
95
96
97
98
99
100
101
102
103
name: Test & Deploy Docs
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
deployments: write
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Cache build outputs
id: build-output
uses: actions/cache@v3
with:
path: build/docs
key: build-output-${{ github.run_id }}
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Build all
run: npm run build && npm run build.debug
- name: Fetch fonts
run: npm run fetch-fonts
- name: Run tests
run: npm run test.unit
###
### Run clean-tree following the build - no changes should be present
###
- name: Clean tree (build)
run: npm run test.clean-tree
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests (none-screenshots)
run: npm run test.int -- --grep-invert @screenshots
- name: Run Playwright tests (screenshots only)
run: npm run test.int -- --grep @screenshots
id: screenshot_tests
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- if: ${{ failure() && steps.screenshot_tests.conclusion == 'failure' }}
run: npm run test.int -- --grep @screenshots --update-snapshots
- if: ${{ failure() && steps.screenshot_tests.conclusion == 'failure' }}
name: Upload screens
uses: actions/upload-artifact@v3
with:
name: integration-tests
path: integration-tests/
retention-days: 10
- name: Build docs
run: npm run docs
- name: copy-to-docs
run: cp -r build/app-debug/ build/docs/app-debug
deploy:
runs-on: macos-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Cache build outputs
id: build-output
uses: actions/cache@v3
with:
path: build/docs
key: build-output-${{ github.run_id }}
- name: Setup Github Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: build/docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2