-
Notifications
You must be signed in to change notification settings - Fork 108
85 lines (80 loc) · 2.66 KB
/
e2e.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
name: e2e
on:
push:
branches:
- develop
pull_request:
branches:
- "*"
merge_group:
workflow_dispatch:
schedule:
# run at 6AM UTC Daily
# 6AM UTC -> 11PM PT
- cron: "0 6 * * *"
jobs:
define-matrix:
runs-on: ubuntu-22.04
env:
GH_TOKEN: ${{ github.token }}
steps:
# use cli rather than event context to avoid race conditions (label added after push)
- name: PR
if: ${{ github.event_name == 'pull_request' }}
run: |
labels=$(gh pr view -R ${{github.repository}} ${{github.event.pull_request.number}} --json labels -q '.labels[].name')
if [[ $labels == *"UPGRADE_TESTS"* ]]; then
if [[ $labels == *"LIGHT_UPGRADE_TESTS"* ]]; then
echo "LIGHT_UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
else
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
fi
fi
if [[ $labels == *"ADMIN_TESTS"* ]]; then
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT
fi
- name: mergegroup
if: ${{ github.event_name == 'merge_group' }}
run: |
labels=$(gh pr view -R ${{github.repository}} ${{github.event.pull_request.number}} --json labels -q '.labels[].name')
if [[ $labels == *"MINIMAL_TESTS"* ]]; then
exit
fi
# TODO: maybe run more tests here
echo "LIGHT_UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
- name: schedule
if: ${{ github.event_name == 'schedule' }}
run: |
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
echo "LIGHT_UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT
e2e:
needs: define-matrix
strategy:
matrix:
include:
- make-target: "start-e2e-test"
runs-on: ubuntu-20.04
run: true
- make-target: "start-upgrade-test"
runs-on: ubuntu-20.04
run: ${{ needs.define-matrix.outputs.UPGRADE_TESTS || false }}
- make-target: "start-upgrade-test-light"
runs-on: ubuntu-20.04
run: ${{ needs.define-matrix.outputs.LIGHT_UPGRADE_TESTS || false }}
- make-target: "start-e2e-admin-test"
runs-on: ubuntu-20.04
run: ${{ needs.define-matrix.outputs.ADMIN_TESTS || false }}
name: ${{ matrix.make-target }}
uses: ./.github/workflows/reusable-e2e.yml
with:
make-target: ${{ matrix.make-target }}
runs-on: ${{ matrix.runs-on}}
run: ${{ matrix.run }}
secrets: inherit
# this allows you to set a required status check
ok:
runs-on: ubuntu-22.04
needs: e2e
steps:
- run: echo "e2e tests passed"