forked from FuelLabs/fuels-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (81 loc) · 2.68 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
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"
test:
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v3
- name: CI Setup
uses: ./.github/actions/test-setup
- 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: Find PR Number
uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Run tests and collect coverage
if: ${{ !steps.findPr.outputs.number }}
run: pnpm ci:test -- --json --coverage --testLocationInResults --outputFile=report.master.json
- name: Upload coverage to Github artifacts
uses: actions/upload-artifact@v3
if: ${{ !steps.findPr.outputs.number }}
with:
name: coverage-reports
path: report.master.json
- name: Download coverage artifact
uses: dawidd6/action-download-artifact@v2
if: ${{ steps.findPr.outputs.number }}
with:
workflow: test.yaml
branch: master
name: coverage-reports
path: coverage-reports
- name: Run tests and post reports to PR
uses: ArtiomTr/jest-coverage-report-action@v2
if: ${{ steps.findPr.outputs.number }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
package-manager: pnpm
annotations: failed-tests
test-script: pnpm ci:test
prnumber: ${{ steps.findPr.outputs.number }}
base-coverage-file: coverage-reports/report.master.json
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 }}