Skip to content

Commit ab9bf35

Browse files
committed
chore: abstract e2e-contract-test action
1 parent 000b51a commit ab9bf35

File tree

6 files changed

+229
-206
lines changed

6 files changed

+229
-206
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: 'E2E Contract Tests'
2+
3+
inputs:
4+
providerUrl:
5+
description: Provider URL (e.g. https://testnet.fuel.network/v1/graphql)
6+
required: true
7+
masterMnemonic:
8+
description: Mnemonic of the master wallet that will fund the tests
9+
required: true
10+
genesisSecret:
11+
description: Secret of genesis to fund the master wallet
12+
required: false
13+
skipDeploy:
14+
description: Skip deploying contracts
15+
required: false
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: FuelLabs/github-actions/setups/node@master
22+
with:
23+
node-version: 18.18.0
24+
pnpm-version: 8.15.7
25+
- uses: FuelLabs/github-actions/setups/docker@master
26+
with:
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Run PNPM install
31+
id: pnpm-cache
32+
run:
33+
pnpm recursive install --frozen-lockfile
34+
35+
- name: Start Test Node
36+
run: pnpm node:up
37+
38+
- name: Generate .env app
39+
run: cp packages/app/.env.example packages/app/.env
40+
41+
- name: Generate .env e2e-contracts
42+
run: cp packages/e2e-contract-tests/.env.example packages/e2e-contract-tests/.env
43+
44+
- name: Build Application
45+
run: pnpm build:all
46+
env:
47+
## increase node.js m memory limit for building
48+
## with sourcemaps
49+
NODE_OPTIONS: "--max-old-space-size=4096"
50+
NODE_ENV: test
51+
52+
- name: Build & Deploy Contracts
53+
if: !inputs.packages
54+
run: pnpm deploy:contracts
55+
working-directory: ./packages/e2e-contract-tests
56+
57+
# E2E tests running with Playwright
58+
- name: Install Playwright Browsers
59+
run: npx playwright install --with-deps chromium
60+
61+
- name: Run E2E Contract Tests
62+
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
63+
env:
64+
NODE_ENV: test
65+
VITE_FUEL_PROVIDER_URL: ${{ inputs.providerUrl }}
66+
VITE_MASTER_WALLET_MNEMONIC: ${{ inputs.masterMnemonic }}
67+
VITE_WALLET_SECRET: ${{ inputs.genesisSecret }}
68+
69+
- uses: actions/upload-artifact@v4
70+
if: always()
71+
with:
72+
name: playwright-report
73+
path: |
74+
packages/app/playwright-report/
75+
packages/app/playwright-html/
76+
retention-days: 30
77+
78+
- name: Stop Test Node
79+
run: pnpm node:clean

.github/workflows/devnet-tests.yaml

+72-72
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
1-
name: Devnet tests
1+
# name: Devnet tests
22

3-
on:
4-
workflow_dispatch:
5-
inputs:
6-
providerUrl:
7-
description: Provider URL (e.g. https://devnet.fuel.network/v1/graphql)
8-
required: false
9-
masterMnemonic:
10-
description: Mnemonic of the wallet that will fund the tests
11-
required: false
12-
push:
13-
branches:
14-
- main
15-
pull_request:
16-
branches: [main, master, sdk-v2]
17-
types: [opened, synchronize, reopened]
3+
# on:
4+
# workflow_dispatch:
5+
# inputs:
6+
# providerUrl:
7+
# description: Provider URL (e.g. https://devnet.fuel.network/v1/graphql)
8+
# required: false
9+
# masterMnemonic:
10+
# description: Mnemonic of the wallet that will fund the tests
11+
# required: false
12+
# push:
13+
# branches:
14+
# - main
15+
# pull_request:
16+
# branches: [main, master, sdk-v2]
17+
# types: [opened, synchronize, reopened]
1818

19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
21-
cancel-in-progress: true
19+
# concurrency:
20+
# group: ${{ github.workflow }}-${{ github.ref }}
21+
# cancel-in-progress: true
2222

23-
jobs:
24-
tests-e2e-contracts:
25-
name: E2E Contract Tests
26-
runs-on: buildjet-4vcpu-ubuntu-2204
27-
steps:
28-
- uses: actions/checkout@v3
29-
- uses: FuelLabs/github-actions/setups/node@master
30-
with:
31-
node-version: 18.18.0
32-
pnpm-version: 8.15.7
33-
- uses: FuelLabs/github-actions/setups/docker@master
34-
with:
35-
username: ${{ github.repository_owner }}
36-
password: ${{ secrets.GITHUB_TOKEN }}
23+
# jobs:
24+
# tests-e2e-contracts:
25+
# name: E2E Contract Tests
26+
# runs-on: buildjet-4vcpu-ubuntu-2204
27+
# steps:
28+
# - uses: actions/checkout@v3
29+
# - uses: FuelLabs/github-actions/setups/node@master
30+
# with:
31+
# node-version: 18.18.0
32+
# pnpm-version: 8.15.7
33+
# - uses: FuelLabs/github-actions/setups/docker@master
34+
# with:
35+
# username: ${{ github.repository_owner }}
36+
# password: ${{ secrets.GITHUB_TOKEN }}
3737

38-
- name: Run PNPM install
39-
id: pnpm-cache
40-
run:
41-
pnpm recursive install --frozen-lockfile
38+
# - name: Run PNPM install
39+
# id: pnpm-cache
40+
# run:
41+
# pnpm recursive install --frozen-lockfile
4242

43-
- name: Start Test Node
44-
run: pnpm node:up
43+
# - name: Start Test Node
44+
# run: pnpm node:up
4545

46-
- name: Generate .env app
47-
run: cp packages/app/.env.example.testnet packages/app/.env
46+
# - name: Generate .env app
47+
# run: cp packages/app/.env.example.testnet packages/app/.env
4848

49-
- name: Generate .env e2e-contracts
50-
run: cp packages/e2e-contract-tests/.env.example.testnet packages/e2e-contract-tests/.env
49+
# - name: Generate .env e2e-contracts
50+
# run: cp packages/e2e-contract-tests/.env.example.testnet packages/e2e-contract-tests/.env
5151

52-
- name: Build Application
53-
run: pnpm build:all
54-
env:
55-
## increase node.js m memory limit for building
56-
## with sourcemaps
57-
NODE_OPTIONS: "--max-old-space-size=4096"
58-
NODE_ENV: test
52+
# - name: Build Application
53+
# run: pnpm build:all
54+
# env:
55+
# ## increase node.js m memory limit for building
56+
# ## with sourcemaps
57+
# NODE_OPTIONS: "--max-old-space-size=4096"
58+
# NODE_ENV: test
5959

60-
- name: Build & Deploy Contracts
61-
run: pnpm deploy:contracts
62-
working-directory: ./packages/e2e-contract-tests
60+
# - name: Build & Deploy Contracts
61+
# run: pnpm deploy:contracts
62+
# working-directory: ./packages/e2e-contract-tests
6363

64-
# E2E tests running with Playwright
65-
- name: Install Playwright Browsers
66-
run: npx playwright install --with-deps chromium
64+
# # E2E tests running with Playwright
65+
# - name: Install Playwright Browsers
66+
# run: npx playwright install --with-deps chromium
6767

68-
- name: Run E2E Contract Tests
69-
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
70-
env:
71-
NODE_ENV: test
72-
VITE_MASTER_WALLET_MNEMONIC: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
73-
VITE_PROVIDER_URL: ${{ inputs.providerUrl || 'https://devnet.fuel.network/v1/graphql' }}
68+
# - name: Run E2E Contract Tests
69+
# run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
70+
# env:
71+
# NODE_ENV: test
72+
# VITE_MASTER_WALLET_MNEMONIC: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
73+
# VITE_PROVIDER_URL: ${{ inputs.providerUrl || 'https://devnet.fuel.network/v1/graphql' }}
7474

75-
- uses: actions/upload-artifact@v4
76-
if: always()
77-
with:
78-
name: playwright-report
79-
path: |
80-
packages/app/playwright-report/
81-
packages/app/playwright-html/
82-
retention-days: 30
75+
# - uses: actions/upload-artifact@v4
76+
# if: always()
77+
# with:
78+
# name: playwright-report
79+
# path: |
80+
# packages/app/playwright-report/
81+
# packages/app/playwright-html/
82+
# retention-days: 30
8383

84-
- name: Stop Test Node
85-
run: pnpm node:clean
84+
# - name: Stop Test Node
85+
# run: pnpm node:clean
8686

.github/workflows/pr-tests.yml

+5-57
Original file line numberDiff line numberDiff line change
@@ -111,64 +111,12 @@ jobs:
111111
run: pnpm node:clean
112112

113113
tests-e2e-contracts:
114-
name: E2E Contract Tests
114+
name: E2E Contract Tests - Local
115115
runs-on: buildjet-4vcpu-ubuntu-2204
116116
steps:
117-
- uses: actions/checkout@v3
118-
- uses: FuelLabs/github-actions/setups/node@master
119-
with:
120-
node-version: 18.18.0
121-
pnpm-version: 8.15.7
122-
- uses: FuelLabs/github-actions/setups/docker@master
123-
with:
124-
username: ${{ github.repository_owner }}
125-
password: ${{ secrets.GITHUB_TOKEN }}
126-
127-
- name: Run PNPM install
128-
id: pnpm-cache
129-
run:
130-
pnpm recursive install --frozen-lockfile
131-
132-
- name: Start Test Node
133-
run: pnpm node:up
134-
135-
- name: Generate .env app
136-
run: cp packages/app/.env.example packages/app/.env
137-
138-
- name: Generate .env e2e-contracts
139-
run: cp packages/e2e-contract-tests/.env.example packages/e2e-contract-tests/.env
140-
141-
- name: Build Application
142-
run: pnpm build:all
143-
env:
144-
## increase node.js m memory limit for building
145-
## with sourcemaps
146-
NODE_OPTIONS: "--max-old-space-size=4096"
147-
NODE_ENV: test
148-
149-
- name: Build & Deploy Contracts
150-
run: pnpm deploy:contracts
151-
working-directory: ./packages/e2e-contract-tests
152-
153-
# E2E tests running with Playwright
154-
- name: Install Playwright Browsers
155-
run: npx playwright install --with-deps chromium
156-
157117
- name: Run E2E Contract Tests
158-
run: xvfb-run --auto-servernum -- pnpm test:e2e:contracts
159-
env:
160-
NODE_ENV: test
161-
VITE_MASTER_WALLET_MNEMONIC: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
162-
163-
- uses: actions/upload-artifact@v4
164-
if: always()
118+
uses: ./.github/actions/e2e-tests-contracts
165119
with:
166-
name: playwright-report
167-
path: |
168-
packages/app/playwright-report/
169-
packages/app/playwright-html/
170-
retention-days: 30
171-
172-
- name: Stop Test Node
173-
run: pnpm node:clean
174-
120+
providerUrl: http://localhost:4000/v1/graphql
121+
masterMnemonic: ${{ secrets.VITE_MASTER_WALLET_MNEMONIC }}
122+
genesisSecret: 0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298

0 commit comments

Comments
 (0)