-
Notifications
You must be signed in to change notification settings - Fork 202
105 lines (86 loc) · 2.69 KB
/
test.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
104
105
name: Test
on:
pull_request:
branches: ["master"]
types:
- opened
- edited
- synchronize
push:
branches: ["master"]
workflow_dispatch:
merge_group:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }}
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID }}
THE_GRAPH_NETWORK_API_KEY: ${{ secrets.THE_GRAPH_NETWORK_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
check-files:
name: Check files
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check-files.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/check-files
id: check-files
test-ui:
name: "Test UI"
runs-on: ubuntu-latest
needs: [check-files]
if: needs.check-files.outputs.run_tests == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
- name: Create build or restore build artifacts
uses: ./.github/actions/build-artifacts/cache
- name: Start UI and Test
run: yarn start-server-and-test 'start' http://127.0.0.1:3000 'yarn test:ci'
audit:
name: "Audit"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
- name: Run audit
run: yarn audit:ci
check-formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node_modules
uses: OffchainLabs/actions/node-modules/install@main
- name: Check formatting with Prettier
run: yarn prettier:check
- name: Check formatting with ESLint
run: yarn lint
e2e-tests:
name: "E2E Tests"
needs: [check-files]
uses: ./.github/workflows/e2e-tests.yml
with:
test_type: 'regular'
secrets: inherit
test-e2e-success:
name: "Test E2E Success"
runs-on: ubuntu-latest
needs: [e2e-tests]
if: always()
steps:
- name: Regular E2E Succeeded
if: needs.e2e-tests.result == 'success' || needs.e2e-tests.result == 'skipped'
run: echo "Regular E2E tests passed"
- name: Regular E2E Failed
if: needs.e2e-tests.result != 'success' && needs.e2e-tests.result != 'skipped'
run: exit 1