Skip to content

Bump the npm_and_yarn group across 14 directories with 5 updates #2

Bump the npm_and_yarn group across 14 directories with 5 updates

Bump the npm_and_yarn group across 14 directories with 5 updates #2

Workflow file for this run

name: Contracts
on:
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FOUNDRY_VERSION: v1.5.0
RISC0_TOOLCHAIN_VERSION: 1.88.0
RISC0_CRATE_VERSION: "3.0.3"
jobs:
contracts-changed:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.changes.outputs.src }}
foundry: ${{ steps.changes.outputs.foundry }}
test: ${{ steps.changes.outputs.test }}
scripts: ${{ steps.changes.outputs.scripts }}
ci: ${{ steps.changes.outputs.ci }}
steps:
- name: checkout code
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3.0.0
id: changes
with:
filters: |
src:
- 'contracts/src/**'
foundry:
- 'foundry.toml'
test:
- 'contracts/test/**'
scripts:
- 'contracts/scripts/**'
ci:
- '.github/workflows/contracts.yml'
gas-snapshots-check:
runs-on: ubuntu-latest
needs: contracts-changed
if: needs.contracts-changed.outputs.src == 'true' ||
needs.contracts-changed.outputs.foundry == 'true' ||
needs.contracts-changed.outputs.test == 'true'
steps:
- name: install npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ env.FOUNDRY_VERSION }}
- name: print forge version
run: forge --version
- name: Ensure gas snapshots have been updated. TODO Fix this. Snapshot checks are currently disabled as they don't match in CI.
run: FORGE_SNAPSHOT_CHECK=false forge test --isolate
upgradability:
runs-on: ubuntu-latest
needs: contracts-changed
if: needs.contracts-changed.outputs.src == 'true' ||
needs.contracts-changed.outputs.foundry == 'true'
steps:
- name: install npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: install @openzeppelin/upgrades-core@1.41.0
run: npm install -g @openzeppelin/upgrades-core@1.41.0
- name: install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ env.FOUNDRY_VERSION }}
- name: checkout main code
uses: actions/checkout@v4
with:
ref: main
submodules: recursive
- name: Forge build on main branch
run: forge build
env:
FOUNDRY_PROFILE: reference-contract
FOUNDRY_OUT: contracts/out
- name: Upload build-info artifact
uses: actions/upload-artifact@v4
with:
name: build-info
path: contracts/out/build-info/
- name: checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build-info artifact
uses: actions/download-artifact@v4
with:
name: build-info
path: contracts/reference-contract/build-info-reference
- name: Run forge test on reference-contract profile
run: forge test -vvv
env:
FOUNDRY_PROFILE: reference-contract
FOUNDRY_OUT: contracts/reference-contract/out
deployment-scripts:
runs-on: [ self-hosted, prod, "${{ matrix.os }}", "${{ matrix.device }}" ]
needs: contracts-changed
if: needs.contracts-changed.outputs.src == 'true' ||
needs.contracts-changed.outputs.foundry == 'true' ||
needs.contracts-changed.outputs.scripts == 'true' ||
needs.contracts-changed.outputs.ci == 'true'
strategy:
# Run only on Linux with CPU.
matrix:
include:
- os: Linux
feature: default
device: cpu
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install yq (GitHub binary)
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.46.1/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tomlkit
run: pip install tomlkit
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.0.0
- uses: risc0/risc0/.github/actions/rustup@v3.0.3
- uses: risc0/risc0/.github/actions/sccache@v3.0.3
with:
key: ${{ matrix.os }}-${{ matrix.feature }}
- name: install cargo risczero
uses: ./.github/actions/bininstall-risc0
with:
risczero-version: ${{ env.RISC0_CRATE_VERSION }}
toolchain-version: ${{ env.RISC0_TOOLCHAIN_VERSION }}
- name: Install protoc
run: sudo apt install protobuf-compiler -y
- name: checkout main code
uses: actions/checkout@v4
with:
ref: main
submodules: recursive
- name: Forge build on main branch
run: forge build
env:
FOUNDRY_PROFILE: reference-contract
FOUNDRY_OUT: contracts/out
- name: Upload build-info artifact
uses: actions/upload-artifact@v4
with:
name: build-info-deployment
path: contracts/out/build-info/
- name: checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download build-info artifact
uses: actions/download-artifact@v4
with:
name: build-info-deployment
path: contracts/build-info-reference
- name: forge build
run: forge build
- name: cargo install boundless-cli
run: cargo install boundless-cli --path crates/boundless-cli --locked
- name: cargo install just
run: cargo install just
- name: cargo build
run: cargo build --locked
- name: spin up local network
run: just localnet up
env:
CI: 1
RISC0_DEV_MODE: 1
REPO_ROOT: ${{ github.workspace }}
- name: deploy script
run: ./contracts/scripts/manage DeployBoundlessMarket --broadcast
env:
CHAIN_KEY: anvil
# This key is a prefunded address for the anvil test configuration (index 0)
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
- name: forge test after new deployment
env:
CHAIN_KEY: anvil
RISC0_DEV_MODE: 1
run: ./contracts/scripts/test --match-contract '^DeploymentTest$'
- name: forge clean
run: forge clean
env:
FOUNDRY_OUT: contracts/out
- name: upgrade script
run: ./contracts/scripts/manage UpgradeBoundlessMarket --broadcast
env:
CHAIN_KEY: anvil
# This key is a prefunded address for the anvil test configuration (index 0)
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
- name: forge test after upgrade
env:
CHAIN_KEY: anvil
RISC0_DEV_MODE: 1
run: ./contracts/scripts/test --match-contract '^DeploymentTest$'
- name: rollback script
run: ./contracts/scripts/manage RollbackBoundlessMarket --broadcast
env:
CHAIN_KEY: anvil
# This key is a prefunded address for the anvil test configuration (index 0)
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
- name: forge test after rollback
env:
CHAIN_KEY: anvil
RISC0_DEV_MODE: 1
run: ./contracts/scripts/test --match-contract '^DeploymentTest$'
- name: Cleanup
if: always()
run: just localnet down
env:
CI: 1
- name: sccache stats
run: sccache --show-stats