-
Notifications
You must be signed in to change notification settings - Fork 1.4k
149 lines (122 loc) · 3.86 KB
/
test.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: "Test"
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docs:
uses: FuelLabs/github-actions/.github/workflows/vp-docs.yml@master
with:
doc-folder-path: "apps/docs/src"
spellcheck-config-path: "apps/docs/.spellcheck.yml"
environments:
runs-on: ubuntu-latest
name: ${{ matrix.env }} - v${{ matrix.version }}
strategy:
fail-fast: false
matrix:
env: [node]
version: [18.18.2, 20]
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v3
- name: CI Setup
uses: ./.github/actions/test-setup
with:
node-version: ${{ matrix.version }}
- name: Verify package.json integrity
run: pnpm lint:package-jsons
- name: Forc Format Check
run: pnpm forc:check
# linting of some tests depends on pretest being run so that it generates the necessary files
- name: Pretest
run: pnpm pretest
- name: Lint
run: pnpm lint
- name: Validate Tests
run: pnpm test:validate
- name: Run Tests - ${{ matrix.env }}
run: pnpm ci:test --${{ matrix.env }}
- name: Upload Coverage - ${{ matrix.env }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.env }}
path: coverage/environments/${{ matrix.env }}
test:
runs-on: ubuntu-latest
needs: [environments]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: CI Setup
uses: ./.github/actions/test-setup
- name: Generate Coverage Directory
run: mkdir -p coverage/environments
- name: Download Coverage Artifact for Node Tests
uses: actions/download-artifact@v3
with:
name: node
path: coverage/environments
- name: Generate Coverage
run: pnpm test:coverage-merge
- name: Find PR Number
uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Upload Master Coverage Artifact
uses: actions/upload-artifact@v3
if: ${{ !steps.findPr.outputs.number }}
with:
name: coverage-master
path: coverage/report
- name: Download Master Coverage Artifact
uses: dawidd6/action-download-artifact@v2
# change to pr number check when rc/salamander has been merged
if: false
with:
workflow: test.yaml
branch: master
name: coverage-master
path: coverage-master
- name: Download Master Coverage Artifact (temporary)
uses: dawidd6/action-download-artifact@v2
if: ${{ (steps.findPr.outputs.number) }}
with:
workflow: test.yaml
run_id: 6628340271
name: coverage-master
path: coverage-master
- name: Generate Coverage Diff
run: pnpm test:coverage-diff
- name: Report Coverage
uses: thollander/actions-comment-pull-request@v2
if: ${{ steps.findPr.outputs.number }}
with:
filePath: coverage/report/coverage-diff.txt
pr_number: ${{ (steps.findPr.outputs.number) }}
comment_tag: diff
mode: recreate
create_if_not_exists: true
live-tests:
name: Run Live Tests
if: github.head_ref == 'changeset-release/master'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: CI Setup
uses: ./.github/actions/test-setup
- name: Pretest
run: pnpm pretest
- name: Run Isolated Tests
run: pnpm test:e2e
env:
FUEL_NETWORK_URL: https://beta-5.fuel.network/graphql
FUEL_NETWORK_GENESIS_KEY: ${{ secrets.FUEL_NETWORK_GENESIS_KEY }}