Skip to content

SIP 323 326 331 332 333 334 335 #6110

SIP 323 326 331 332 333 334 335

SIP 323 326 331 332 333 334 335 #6110

Workflow file for this run

name: Test
on:
pull_request: {}
jobs:
test:
runs-on: ubuntu-latest
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",
]
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: "16.20.1"
cache: "yarn"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Cache Hardhat artifacts
uses: actions/cache@v3
with:
key: hardhat-${{ matrix.workspace }}-${{ github.head_ref }}-${{ steps.date.outputs.date }}
restore-keys: |
hardhat-test-${{ matrix.workspace }}-${{ github.head_ref }}
hardhat-test-${{ matrix.workspace }}
path: |
markets/**/cache
markets/**/artifacts
markets/**/test/generated
markets/**/typechain-types
protocol/**/cache
protocol/**/artifacts
protocol/**/test/generated
protocol/**/typechain-types
- name: Cache Cannon packages
uses: actions/cache@v3
with:
key: cannon-${{ matrix.workspace }}-${{ github.head_ref }}-${{ steps.date.outputs.date }}
restore-keys: |
cannon-test-${{ matrix.workspace }}-${{ github.head_ref }}
cannon-test-${{ matrix.workspace }}
path: |
~/.local/share/cannon
- 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
run: |
if yarn workspace ${{ matrix.workspace }} run | grep test; then
REPORT_GAS=true yarn workspace ${{ matrix.workspace }} run test
else
echo 'SKIP. No "test" script'
fi