-
Notifications
You must be signed in to change notification settings - Fork 42
149 lines (119 loc) · 4.54 KB
/
pr-tests.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
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: Tests
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
push:
branches:
- release
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
FORC_VERSION: 0.63.3
CORE_VERSION: 0.35.0
jobs:
tests-vitest:
name: Vitest Tests
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
pnpm-version: 9.5.0
- uses: FuelLabs/github-actions/setups/docker@master
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Fuel toolchain
uses: FuelLabs/[email protected]
with:
name: my-toolchain
components: forc@${{ env.FORC_VERSION }}, fuel-core@${{ env.CORE_VERSION }}
- name: Find PR number
uses: jwalton/gh-find-current-pr@v1
if: ${{ github.event_name == 'pull_request' }}
id: findPr
- name: Run Vitest
run: |
pnpm test:ci
- name: Publish Fuel Wallet Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: ${{ always() && steps.findPr.outputs.number }}
with:
name: 'Fuel Wallet'
working-directory: ./packages/fuel-wallet
json-summary-path: ./coverage/coverage-summary.json
json-final-path: ./coverage/coverage-final.json
- name: Publish Fuel Development Wallet Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: ${{ always() && steps.findPr.outputs.number }}
with:
name: 'Fuel Development Wallet'
working-directory: ./packages/fuel-development-wallet
json-summary-path: ./coverage/coverage-summary.json
json-final-path: ./coverage/coverage-final.json
- name: Publish Fuelet Wallet Coverage
uses: davelosert/vitest-coverage-report-action@v2
if: ${{ always() && steps.findPr.outputs.number }}
with:
name: 'Fuelet Wallet'
working-directory: ./packages/fuelet-wallet
json-summary-path: ./coverage/coverage-summary.json
json-final-path: ./coverage/coverage-final.json
tests-e2e-connectors:
name: E2E
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Setup Node
uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
pnpm-version: 9.5.0
- uses: FuelLabs/github-actions/setups/docker@master
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Start Test Node
run: pnpm node:up
- name: Run PNPM install
id: pnpm-cache
run: pnpm install --frozen-lockfile
- name: Copy .env file for E2E Tests
run: cp e2e-tests/runner/.env.example e2e-tests/runner/.env
- name: Copy .env file for React Next
run: cp e2e-tests/react-next/.env.example e2e-tests/react-next/.env
- name: Copy .env file for React App
run: cp examples/react-app/.env.example examples/react-app/.env
- name: Run build:connectors
run: pnpm build:connectors
- uses: ./.github/workflows/setup-rust
- name: Verify Forc and Fuel-Core
run: |
forc --version
fuel-core --version
- name: Build & Deploy Contracts
run: pnpm deploy:contracts:ci
working-directory: e2e-tests/runner/scripts
- name: Build & Deploy EVM Predicates
run: pnpm fuels build && pnpm fuels deploy
working-directory: packages/evm-predicates
- name: Build & Deploy Solana Predicates
run: pnpm fuels build && pnpm fuels deploy
working-directory: packages/solana-connector
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps chromium
working-directory: e2e-tests/runner
- name: Build Synpress cache
run: xvfb-run pnpm synpress wallet-setup
working-directory: e2e-tests/runner
- name: Run Playwright tests locally for Preview
if: ${{ github.event_name == 'pull_request' }}
run: xvfb-run --auto-servernum -- pnpm --filter @e2e-tests/runner test:e2e
env:
VITE_MASTER_WALLET_MNEMONIC: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}