Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 CI fix hardhat not loading solc on Node18 #1760

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.0"
node-version: "18.15.0"
cache: "yarn"

# The following steps are for checking the validity of the yarn.lock edits.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.0"
node-version: "18.15.0"
cache: "yarn"
- run: yarn --version
- run: yarn install --immutable --immutable-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.0"
node-version: "18.15.0"
cache: "yarn"
- run: yarn --version
- run: yarn install --immutable --immutable-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/simulate-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.0"
node-version: "18.15.0"
cache: "yarn"
- uses: ibnesayeed/setup-ipfs@92d412e0dad36c06ffab50733e9c624896a0964f
with:
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/test-with-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Coverage

on:
push:
branches:
- "main"

jobs:
coverage:
runs-on: ubuntu-latest
env:
CANNON_IPFS_URL: "http://127.0.0.1:5001"
CANNON_PUBLISH_IPFS_URL: "http://127.0.0.1:5001"
strategy:
fail-fast: false
matrix:
workspace: [
"@synthetixio/main",
"@synthetixio/oracle-manager",
# "@synthetixio/governance", # no tests :/

"@synthetixio/core-contracts",
"@synthetixio/core-utils",
"@synthetixio/core-modules",
"@synthetixio/hardhat-storage",
"@synthetixio/sample-project",

# "@synthetixio/legacy-market", # tests fail
"@synthetixio/spot-market",
"@synthetixio/perps-market",

"@synthetixio/core-subgraph",
"@synthetixio/spot-market-subgraph",
"@synthetixio/perps-market-subgraph",
]

include:
- workspace: "@synthetixio/main"
codecov-file: protocol/synthetix/coverage.json
codecov-flags: main

- workspace: "@synthetixio/oracle-manager"
codecov-file: protocol/oracle-manager/coverage.json
codecov-flags: oracle-manager

- workspace: "@synthetixio/core-contracts"
codecov-file: utils/core-contracts/coverage.json
codecov-flags: core-contracts

- workspace: "@synthetixio/core-utils"
codecov-file: utils/core-utils/coverage/lcov.info
codecov-flags: core-utils

- workspace: "@synthetixio/core-modules"
codecov-file: utils/core-modules/coverage.json
codecov-flags: core-modules

- workspace: "@synthetixio/hardhat-storage"
codecov-file: utils/hardhat-storage/coverage/lcov.info
codecov-flags: hardhat-storage

- workspace: "@synthetixio/sample-project"
codecov-file: utils/sample-project/coverage.json
codecov-flags: sample-project

steps:
- name: Install Foundry (Cannon)
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- run: anvil -V
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.15.0"
cache: "yarn"
- uses: ibnesayeed/setup-ipfs@92d412e0dad36c06ffab50733e9c624896a0964f
with:
run_daemon: true

- run: yarn install --immutable --immutable-cache
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "${{ matrix.workspace }}" run build:ts
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "${{ matrix.workspace }}" run build-testable

- name: Execute size-contracts command
run: |
if yarn workspace ${{ matrix.workspace }} run | grep size-contracts; then
yarn workspace ${{ matrix.workspace }} run size-contracts
else
echo 'SKIP. No "size-contracts" script'
fi

- name: Check storage.dump.sol is up-to-date
run: |
if yarn workspace ${{ matrix.workspace }} run | grep check:storage; then
yarn workspace ${{ matrix.workspace }} run check:storage
else
echo 'SKIP. No "check:storage" script'
fi

- name: Execute tests with coverage
run: |
if yarn workspace ${{ matrix.workspace }} run | grep coverage; then
REPORT_GAS=true yarn workspace ${{ matrix.workspace }} run coverage
else
echo 'SKIP. No "coverage" script'
fi

- if: ${{ matrix.codecov-file }}
name: Upload ${{ matrix.workspace }} coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ${{ matrix.codecov-file }}
flags: ${{ matrix.codecov-flags }}
82 changes: 25 additions & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Test

on:
pull_request: {}
push:
branches:
- "main"

jobs:
test:
Expand All @@ -15,46 +12,26 @@ jobs:
strategy:
fail-fast: false
matrix:
package:
[
core-contracts,
core-utils,
core-modules,
sample-project,
main,
oracle-manager,
spot-market,
perps-market,
core-subgraph,
spot-market-subgraph,
perps-market-subgraph,
workspace: [
"@synthetixio/main",
"@synthetixio/oracle-manager",
# "@synthetixio/governance", # no tests :/

"@synthetixio/core-contracts",
"@synthetixio/core-utils",
"@synthetixio/core-modules",
"@synthetixio/hardhat-storage",
"@synthetixio/sample-project",

# "@synthetixio/legacy-market", # tests fail
"@synthetixio/spot-market",
"@synthetixio/perps-market",

"@synthetixio/core-subgraph",
"@synthetixio/spot-market-subgraph",
"@synthetixio/perps-market-subgraph",
]
include:
- package: core-contracts
workspace: "@synthetixio/core-contracts"
coverage-file: utils/core-contracts/coverage.json
- package: core-utils
workspace: "@synthetixio/core-utils"
coverage-file: utils/core-utils/coverage/lcov.info
- package: core-modules
workspace: "@synthetixio/core-modules"
coverage-file: utils/core-modules/coverage.json
- package: sample-project
workspace: "@synthetixio/sample-project"
- package: oracle-manager
workspace: "@synthetixio/oracle-manager"
- package: spot-market
workspace: "@synthetixio/spot-market"
- package: perps-market
workspace: "@synthetixio/perps-market"
- package: main
workspace: "@synthetixio/main"
- package: core-subgraph
workspace: "@synthetixio/core-subgraph"
- package: spot-market-subgraph
workspace: "@synthetixio/spot-market-subgraph"
- package: perps-market-subgraph
workspace: "@synthetixio/perps-market-subgraph"

steps:
- name: Install Foundry (Cannon)
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -64,17 +41,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.20.1"
node-version: "18.15.0"
cache: "yarn"
- uses: ibnesayeed/setup-ipfs@92d412e0dad36c06ffab50733e9c624896a0964f
with:
run_daemon: true

- run: yarn install --immutable --immutable-cache

- run: yarn workspaces foreach --topological-dev --recursive --verbose --from ${{ matrix.workspace }} run build:ts

- run: yarn workspaces foreach --topological-dev --recursive --verbose --from ${{ matrix.workspace }} run build-testable
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "${{ matrix.workspace }}" run build:ts
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "${{ matrix.workspace }}" run build-testable

- name: Execute size-contracts command
run: |
Expand All @@ -94,15 +69,8 @@ jobs:

- name: Execute tests
run: |
if yarn workspace ${{ matrix.workspace }} run | grep coverage; then
REPORT_GAS=true yarn workspace ${{ matrix.workspace }} run coverage
if yarn workspace ${{ matrix.workspace }} run | grep test; then
REPORT_GAS=true yarn workspace ${{ matrix.workspace }} run test
else
echo 'SKIP. No "coverage" script'
echo 'SKIP. No "test" script'
fi

- if: ${{ matrix.coverage-file }}
name: Upload ${{ matrix.workspace }} coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ${{ matrix.coverage-file }}
flags: ${{ matrix.package }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"markets/**"
],
"engines": {
"node": "^18.16.0"
"node": "^18.15.0"
},
"packageManager": "[email protected]"
}
Loading