Skip to content

Commit 1372236

Browse files
d10rhellwolf
andauthored
Use fuji as canary testnet & Nixify some workflws (#1373)
* use fuji as canary testnet. * when trying to fix excessive binary downloading in foundry and hardhat tooling, some workflows are nixified. * make shellcheck optional for local development. --------- Co-authored-by: Miao, ZhiCheng <[email protected]>
1 parent b5cf515 commit 1372236

28 files changed

+922
-1038
lines changed

.github/workflows/call.check-query-schema-against-subgraph.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ jobs:
1616
env:
1717
sdk-core-working-directory: ./packages/sdk-core
1818

19+
defaults:
20+
run:
21+
shell: nix develop -c bash {0}
22+
1923
steps:
2024
- uses: actions/checkout@v3
2125

22-
- name: Use Node.js 18.x
23-
uses: actions/setup-node@v3
26+
- uses: cachix/install-nix-action@v19
2427
with:
25-
node-version: 18.x
26-
cache: "yarn"
28+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2729

2830
- name: "Install dependencies"
2931
run: yarn install --frozen-lockfile

.github/workflows/call.deploy-hosted-service-subgraph.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ jobs:
4242
env:
4343
subgraph-working-directory: ./packages/subgraph
4444

45+
defaults:
46+
run:
47+
shell: nix develop -c bash {0}
48+
4549
steps:
4650
- uses: actions/checkout@v3
4751

48-
- name: "Install node"
49-
uses: "actions/setup-node@v3"
52+
- uses: cachix/install-nix-action@v19
5053
with:
51-
node-version: "16"
52-
cache: "yarn"
54+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
5355

5456
- name: "Install dependencies"
5557
run: yarn install --frozen-lockfile

.github/workflows/call.test-automation-contracts.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
node-version: [ 16.x, 18.x ]
14+
node-version: [ 16, 18 ]
15+
16+
defaults:
17+
run:
18+
shell: nix develop .#ci-node${{ matrix.node-version }} -c bash {0}
1519

1620
steps:
1721
- uses: actions/checkout@v3
1822

19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v3
23+
- uses: cachix/install-nix-action@v19
2124
with:
22-
node-version: ${{ matrix.node-version }}
23-
cache: "yarn"
25+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2426

2527
- name: Install, lint and build
2628
run: |
2729
yarn install --frozen-lockfile
2830
yarn lint
2931
yarn build
3032
31-
- name: Install Foundry
32-
uses: foundry-rs/foundry-toolchain@v1
33-
with:
34-
version: nightly
35-
3633
- name: Test automation-contracts-scheduler
3734
run: |
35+
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
36+
echo "FOUNDRY_SOLC_VERSION=$SOLC_PATH" >> $GITHUB_ENV
3837
yarn workspace scheduler test
3938
4039
- name: Test automation-contracts-autowrap
4140
run: |
41+
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
42+
echo "FOUNDRY_SOLC_VERSION=$SOLC_PATH" >> $GITHUB_ENV
4243
yarn workspace autowrap test
43-

.github/workflows/call.test-local-subgraph.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ jobs:
77
subgraph-unit-tests:
88
name: Run subgraph unit tests
99
runs-on: ubuntu-latest
10-
10+
11+
defaults:
12+
run:
13+
shell: nix develop -c bash {0}
14+
1115
steps:
1216
- uses: actions/checkout@v3
1317

14-
- name: Use Node.js 18.x
15-
uses: actions/setup-node@v3
18+
- uses: cachix/install-nix-action@v19
1619
with:
17-
node-version: 18.x
18-
cache: "yarn"
20+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
1921

2022
- name: "Install dependencies"
2123
run: yarn install --frozen-lockfile
@@ -37,14 +39,16 @@ jobs:
3739
subgraph-working-directory: ./packages/subgraph
3840
sdk-core-working-directory: ./packages/sdk-core
3941

42+
defaults:
43+
run:
44+
shell: nix develop -c bash {0}
45+
4046
steps:
4147
- uses: actions/checkout@v3
4248

43-
- name: Use Node.js 18.x
44-
uses: actions/setup-node@v3
49+
- uses: cachix/install-nix-action@v19
4550
with:
46-
node-version: 18.x
47-
cache: "yarn"
51+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
4852

4953
- name: "Install dependencies"
5054
run: yarn install --frozen-lockfile

.github/workflows/call.test-sdk-core.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ jobs:
2424
subgraph-working-directory: ./packages/subgraph
2525
sdk-core-working-directory: ./packages/sdk-core
2626

27+
defaults:
28+
run:
29+
shell: nix develop -c bash {0}
30+
2731
steps:
2832
- uses: actions/checkout@v3
2933

30-
- name: Use Node.js 18.x
31-
uses: actions/setup-node@v3
34+
- uses: cachix/install-nix-action@v19
3235
with:
33-
node-version: 18.x
34-
cache: "yarn"
36+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
3537

3638
- name: "Install dependencies"
3739
run: yarn install --frozen-lockfile

.github/workflows/call.test-spec-haskell.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ jobs:
2929
with:
3030
github_access_token: ${{ secrets.GITHUB_TOKEN }}
3131

32-
- name: cache
33-
uses: actions/cache@v2
34-
with:
35-
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
36-
path: ~/.cabal/store
37-
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
38-
3932
- name: Create devShell
4033
run: |
4134
echo 'nix develop .#${{ matrix.devShell }} -c bash $@' > devShell.sh

.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ jobs:
3030
contracts-working-directory: ./packages/ethereum-contracts
3131
sdk-core-working-directory: ./packages/sdk-core
3232

33+
defaults:
34+
run:
35+
shell: nix develop -c bash {0}
36+
3337
steps:
3438
- uses: actions/checkout@v3
3539

36-
- name: Use Node.js 18.x
37-
uses: actions/setup-node@v3
40+
- uses: cachix/install-nix-action@v19
3841
with:
39-
node-version: 18.x
40-
cache: "yarn"
42+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
4143

4244
- name: "Install dependencies"
4345
run: yarn install --frozen-lockfile

.github/workflows/cd.feature.create-pr-artifact.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414

15+
defaults:
16+
run:
17+
shell: nix develop -c bash {0}
18+
1519
if: ${{ !github.event.pull_request.draft }}
1620

1721
steps:
1822
- uses: actions/checkout@v3
1923

20-
- name: Use Node.js 18.x
21-
uses: actions/setup-node@v3
24+
- uses: cachix/install-nix-action@v19
2225
with:
23-
node-version: 18.x
24-
cache: "yarn"
26+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2527

2628
- name: Show context
2729
env:

.github/workflows/ci.canary.yml

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,21 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
node-version: [16.x, 18.x]
22+
node-version: [16, 18]
23+
24+
defaults:
25+
run:
26+
shell: nix develop .#ci-node${{ matrix.node-version }} -c bash {0}
2327

2428
steps:
2529
- uses: actions/checkout@v3
2630
with:
2731
submodules: recursive
2832

33+
- uses: cachix/install-nix-action@v19
34+
with:
35+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
36+
2937
- name: Show contexts
3038
env:
3139
HEAD_REF: ${{ github.head_ref }}
@@ -37,22 +45,14 @@ jobs:
3745
echo github.ref: "$GITHUB_REF"
3846
echo github.head_ref: "$HEAD_REF"
3947
echo github.base_ref: ${{ github.base_ref }}
40-
- name: Use Node.js ${{ matrix.node-version }}
41-
uses: actions/setup-node@v3
42-
with:
43-
node-version: ${{ matrix.node-version }}
44-
cache: "yarn"
45-
46-
- name: Install Foundry
47-
uses: foundry-rs/foundry-toolchain@v1
48-
with:
49-
version: nightly
5048
5149
- name: Install, lint, build, and test
5250
run: |
5351
yarn install --frozen-lockfile
5452
yarn lint
5553
yarn build
54+
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
55+
echo "FOUNDRY_SOLC_VERSION=$SOLC_PATH" >> $GITHUB_ENV
5656
yarn test
5757
env:
5858
POLYGON_MAINNET_PROVIDER_URL: ${{ secrets.POLYGON_MAINNET_PROVIDER_URL }}
@@ -96,8 +96,7 @@ jobs:
9696
if: needs.check.outputs.build_subgraph
9797
with:
9898
release_branch: dev
99-
# empty string network deploys to all networks
100-
network: ""
99+
network: "all"
101100
secrets:
102101
THE_GRAPH_ACCESS_TOKEN: ${{ secrets.THE_GRAPH_ACCESS_TOKEN }}
103102

@@ -114,24 +113,23 @@ jobs:
114113

115114
runs-on: ubuntu-latest
116115

116+
defaults:
117+
run:
118+
shell: nix develop -c bash {0}
119+
117120
steps:
118121
- uses: actions/checkout@v3
119122

120-
- name: Use Node.js 18.x
121-
uses: actions/setup-node@v3
123+
- uses: cachix/install-nix-action@v19
122124
with:
123-
node-version: 18.x
124-
cache: "yarn"
125+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
125126

126-
- name: Install Foundry
127-
uses: foundry-rs/foundry-toolchain@v1
128-
with:
129-
version: nightly
130-
131-
- name: Run coverage test
127+
- name: Install, run coverage test
132128
run: |
133129
yarn install --frozen-lockfile
134130
yarn build
131+
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
132+
echo "FOUNDRY_SOLC_VERSION=$SOLC_PATH" >> $GITHUB_ENV
135133
yarn workspace @superfluid-finance/ethereum-contracts test-coverage
136134
137135
- name: Install lcov
@@ -156,7 +154,7 @@ jobs:
156154
coverage-sdk-core:
157155
uses: ./.github/workflows/call.test-sdk-core.yml
158156
name: Build and Test SDK-Core Coverage (Canary Branch)
159-
with:
157+
with:
160158
subgraph-release: local
161159
subgraph-endpoint: http://localhost:8000/subgraphs/name/superfluid-test
162160
run-coverage-tests: true
@@ -237,15 +235,16 @@ jobs:
237235

238236
runs-on: ubuntu-latest
239237

238+
defaults:
239+
run:
240+
shell: nix develop -c bash {0}
241+
240242
steps:
241243
- uses: actions/checkout@v3
242244

243-
- name: Use Node.js 18.x
244-
uses: actions/setup-node@v3
245+
- uses: cachix/install-nix-action@v19
245246
with:
246-
node-version: 18.x
247-
cache: "yarn"
248-
registry-url: https://registry.npmjs.org/
247+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
249248

250249
- name: Install dependencies
251250
run: yarn install --frozen-lockfile
@@ -279,6 +278,10 @@ jobs:
279278

280279
runs-on: ubuntu-latest
281280

281+
defaults:
282+
run:
283+
shell: nix develop -c bash {0}
284+
282285
steps:
283286
- uses: actions/checkout@v3
284287

@@ -287,12 +290,9 @@ jobs:
287290
repository: superfluid-finance/build-scripts
288291
path: build-scripts
289292

290-
- name: Use Node.js 18.x
291-
uses: actions/setup-node@v3
293+
- uses: cachix/install-nix-action@v19
292294
with:
293-
node-version: 18.x
294-
cache: "yarn"
295-
registry-url: https://registry.npmjs.org/
295+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
296296

297297
- name: Install dependencies
298298
run: yarn install --frozen-lockfile
@@ -330,7 +330,7 @@ jobs:
330330
cloudfront_distribution_id: E3JEO5R14CT8IH
331331

332332
upgrade-contracts:
333-
name: Upgrade ethereum-contracts on goerli testnet (protocol release version "test")
333+
name: Upgrade ethereum-contracts on canary testnet (protocol release version "test")
334334

335335
needs: [all-packages-tested]
336336

@@ -339,16 +339,18 @@ jobs:
339339
strategy:
340340
fail-fast: false
341341
matrix:
342-
network: [goerli]
342+
network: [avalanche-fuji]
343+
344+
defaults:
345+
run:
346+
shell: nix develop -c bash {0}
343347

344348
steps:
345349
- uses: actions/checkout@v3
346350

347-
- name: Use Node.js 18.x
348-
uses: actions/setup-node@v3
351+
- uses: cachix/install-nix-action@v19
349352
with:
350-
node-version: 18.x
351-
cache: "yarn"
353+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
352354

353355
- name: Build
354356
run: |
@@ -361,5 +363,5 @@ jobs:
361363
npx truffle exec --network ${{ matrix.network }} ops-scripts/deploy-test-environment.js
362364
env:
363365
RELEASE_VERSION: master
364-
ETH_GOERLI_MNEMONIC: ${{ secrets.BUILD_AGENT_MNEMONIC }}
365-
ETH_GOERLI_PROVIDER_URL: ${{ secrets.ETH_GOERLI_PROVIDER_URL }}
366+
AVALANCHE_FUJI_MNEMONIC: ${{ secrets.BUILD_AGENT_MNEMONIC }}
367+
AVALANCHE_FUJI_PROVIDER_URL: ${{ secrets.AVALANCHE_FUJI_PROVIDER_URL }}

0 commit comments

Comments
 (0)