Add docker image tests #677
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FOUNDRY_PROFILE: ci | |
jobs: | |
contracts-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Run Forge build | |
run: | | |
just build-contracts | |
id: build | |
- name: Run Forge tests | |
run: | | |
just test-contracts | |
id: test | |
go-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Setup golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.59 | |
args: --timeout=5m | |
- name: Install dependencies | |
run: go mod download | |
- name: Run linter | |
run: just lint-go | |
go-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Install dependencies | |
run: go mod download | |
- name: Run tests | |
run: just test-go | |
env: | |
SUPERSIM_RPC_URL_OP: ${{ vars.SUPERSIM_RPC_URL_OP }} | |
SUPERSIM_RPC_URL_BASE: ${{ vars.SUPERSIM_RPC_URL_BASE }} | |
docker-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: ${{ matrix.platform }} | |
outputs: type=docker,name=supersim:dev | |
cache-from: type=gha,scope=build-${{ matrix.platform }} | |
cache-to: type=gha,mode=max,scope=build-${{ matrix.platform }} | |
- name: Smoke test docker image | |
run: docker run supersim:dev --help |