-
Notifications
You must be signed in to change notification settings - Fork 58
93 lines (88 loc) · 3.06 KB
/
build-test-lint-simple.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: Build, Test, Lint for Pull Requests
env:
CI: true
FORCE_COLOR: 1
NODE_OPTIONS: --max_old_space_size=4096
on:
workflow_call:
schedule:
- cron: "0 3 * * *"
jobs:
setup:
name: Setup, Build, Lint and Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event_name == 'schedule' && 'main' || github.event.pull_request.head.sha }}
- name: Build
uses: ./.github/actions/build
- name: Lint
run: npm run lint
- name: Check
run: npm run check
- name: Test
if: ${{ github.event_name == 'schedule' || github.event.label.name == 'ready-to-test' }}
run: npm run test --quiet --colors
- name: Run deprecated playwright tests
if: ${{ github.event_name == 'schedule' || github.event.label.name == 'ready-to-test' }}
uses: ./.github/actions/playwright
with:
node-test-script: test:components-functional
test-results-name: Deprecated tests for editing functionality
smoke-vital:
name: Smoke tests for vital components
if: ${{ github.event_name == 'schedule' || github.event.label.name == 'ready-to-test' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event_name == 'schedule' && 'main' || github.event.pull_request.head.sha }}
- name: Build
uses: ./.github/actions/build
- name: Run vital playwright tests
env:
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_BATCH_NAME: ${{ github.event_name == 'schedule' && 'Regression Test Run' || format('{0} ({1})', github.event.pull_request.title, github.event.pull_request.number) }}
PW_INCLUDE_ALL_RENDERERS: ${{ github.event_name == 'schedule' }}
uses: ./.github/actions/playwright
with:
node-test-script: test:components-visual
test-results-name: Smoke tests for vital components
- name: Upload Accessibility results
if: always()
uses: actions/upload-artifact@v2
with:
name: Accessibility
path: accessibility-reports/
retention-days: 30
cleanup:
if: always() && github.event_name != 'schedule'
runs-on: ubuntu-20.04
needs: [ setup, smoke-vital ]
permissions:
pull-requests: write
steps:
- uses: actions-ecosystem/action-remove-labels@v1
if: always()
with:
labels: ${{ github.event.label.name }}
fail_on_error: false
test-results:
name: Test Results
if: always() && github.event.label.name == 'ready-to-test'
runs-on: ubuntu-latest
needs: [ setup, smoke-vital ]
permissions:
checks: write
pull-requests: write
steps:
- name: Download file
uses: actions/download-artifact@v3
with:
path: playwright-report/
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
check_name: 'Playwright Test Results'
files: "playwright-report/**/*.xml"