Skip to content

Commit

Permalink
fixing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferret-san committed Nov 5, 2024
1 parent 7e5a88a commit d55d9b5
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 46 deletions.
92 changes: 57 additions & 35 deletions .github/workflows/cannon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,46 @@ on:
workflow_dispatch:

jobs:
contracts-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
working-directory: packages/contracts-bedrock
run: just install

- name: Pull artifacts
working-directory: packages/contracts-bedrock
run: bash scripts/ops/pull-artifacts.sh

- name: Build contracts
working-directory: packages/contracts-bedrock
run: forge build --deny-warnings

- name: Upload contract artifacts
uses: actions/upload-artifact@v4
with:
name: contract-artifacts
path: |
packages/contracts-bedrock/artifacts
packages/contracts-bedrock/forge-artifacts
packages/contracts-bedrock/cache
cannon-prestate:
needs: [contracts-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download contract artifacts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: packages/contracts-bedrock

- name: Build cannon
run: make cannon
Expand All @@ -25,7 +61,7 @@ jobs:

- name: Cache cannon prestate
id: cache-prestate
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
op-program/bin/prestate.bin.gz
Expand All @@ -43,17 +79,8 @@ jobs:
- name: Generate cannon-mt prestate
run: make cannon-prestate-mt

- name: Cache cannon-mt prestate
uses: actions/cache@v3
with:
path: |
op-program/bin/prestate-mt.json
op-program/bin/meta-mt.json
op-program/bin/prestate-proof-mt.json
key: cannon-prestate-mt-${{ hashFiles('cannon/bin/cannon') }}-${{ hashFiles('op-program/bin/op-program-client.elf') }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Upload prestate artifacts
uses: actions/upload-artifact@v4
with:
name: prestate-artifacts
path: |
Expand All @@ -62,13 +89,19 @@ jobs:
op-program/bin/prestate-proof.json
cannon-go-test:
needs: [contracts-build]
runs-on: ubuntu-latest
needs: [cannon-prestate]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download contract artifacts
uses: actions/download-artifact@v4
with:
name: contract-artifacts
path: packages/contracts-bedrock

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"

Expand All @@ -80,39 +113,28 @@ jobs:
working-directory: cannon
run: make lint

- name: Create test results directory
run: |
mkdir -p tmp/test-results
mkdir -p tmp/testlogs
- name: Run tests
working-directory: cannon
run: |
go install gotest.tools/gotestsum@latest
gotestsum --format=testname --junitfile=../tmp/test-results/cannon.xml --jsonfile=../tmp/testlogs/log.json \
-- -parallel=$(nproc) -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage.out ./...
-- -parallel="$(nproc)" -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage.out ./...
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ./cannon/coverage.out
flags: cannon-go-tests

- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
tmp/test-results
tmp/testlogs
op-e2e-cannon-tests:
runs-on: ubuntu-latest
needs: [cannon-prestate]
steps:
- uses: actions/checkout@v3

- name: Download prestate artifacts
uses: actions/download-artifact@v3
with:
name: prestate-artifacts

- name: Run cannon tests
working-directory: op-e2e
run: |
make test-cannon
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ env:

on:
push:
branches: [main, develop]
branches: [celestia-develop]
pull_request:
branches: [main, develop]
branches: [celestia-develop]
workflow_dispatch:

jobs:
Expand All @@ -34,20 +34,20 @@ jobs:
- op-supervisor
- cannon
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -65,7 +65,7 @@ jobs:
- name: Upload Docker image
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-${{ matrix.component }}
path: /tmp/${{ matrix.component }}.tar
4 changes: 1 addition & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Validate workflows
uses: docker://rhysd/actionlint:latest
with:
args: -color

0 comments on commit d55d9b5

Please sign in to comment.