-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't install go for `cannon-rs` tests
- Loading branch information
Showing
7 changed files
with
133 additions
and
23 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: FPVM | ||
on: [push] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build-example-programs: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
fpvm: ["cannon", "asterisc"] | ||
name: build-${{ matrix.fpvm }}-examples | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
- name: Prepare | ||
id: prep | ||
run: echo "::set-output name=timestamp::$(date +%s)" | ||
- name: Install Rust stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@just | ||
- name: Log into ghcr | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build ${{ matrix.fpvm }} examples | ||
working-directory: ./fpvm-tests | ||
run: just build-${{ matrix.fpvm }}-examples | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: images-${{ matrix.fpvm }} | ||
path: | | ||
examples/minimal/target/${{ matrix.fpvm == 'cannon' && 'mips-unknown-none' || 'riscv64gc-unknown-none-elf' }}/release/minimal | ||
examples/simple-revm/target/${{ matrix.fpvm == 'cannon' && 'mips-unknown-none' || 'riscv64gc-unknown-none-elf' }}/release/simple-revm | ||
fpvm-example-tests: | ||
needs: build-example-programs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
fpvm: ["cannon-go", "cannon-rs", "asterisc"] | ||
name: ${{ matrix.fpvm }}-tests | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
- name: Install Rust nightly toolchain | ||
if: contains(matrix.fpvm, 'cannon-rs') | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: Install xsltproc | ||
if: contains(matrix.fpvm, 'cannon-rs') | ||
run: sudo apt-get install xsltproc | ||
- name: Setup Go toolchain | ||
if: "!contains(matrix.fpvm , 'cannon-rs')" | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21.6" | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- uses: taiki-e/install-action@just | ||
- name: Download Binaries | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: images-${{ contains(matrix.fpvm, 'cannon') && 'cannon' || 'asterisc' }} | ||
- name: Restore Targets | ||
run: | | ||
TARGET="${{ contains(matrix.fpvm, 'cannon') && 'mips-unknown-none' || 'riscv64gc-unknown-none-elf' }}" | ||
mkdir -p examples/minimal/target/$TARGET/release | ||
mkdir -p examples/simple-revm/target/$TARGET/release | ||
mv minimal examples/minimal/target/$TARGET/release | ||
mv simple-revm examples/simple-revm/target/$TARGET/release | ||
- name: Run FPVM tests | ||
working-directory: ./fpvm-tests | ||
run: just test-${{ matrix.fpvm }} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
# Test all FPVM targets | ||
test: test-cannon test-asterisc | ||
test: build-cannon-examples build-asterisc-examples test-cannon test-asterisc | ||
|
||
# Test programs on `cannon` | ||
test-cannon: | ||
# Build the programs | ||
# Build cannon programs | ||
build-cannon-examples: | ||
@cd ../examples/minimal && just build-cannon --release | ||
@cd ../examples/simple-revm && just build-cannon --release | ||
|
||
# Build asterisc programs | ||
build-asterisc-examples: | ||
@cd ../examples/minimal && just build-asterisc --release | ||
@cd ../examples/simple-revm && just build-asterisc --release | ||
|
||
# Test programs on `cannon` | ||
test-cannon: test-cannon-go test-cannon-rs | ||
|
||
# Test programs on `cannon` | ||
test-cannon-go: | ||
# Run Cannon tests | ||
@cd cannon-tests && go test -count=1 -v ./... | ||
|
||
# Test programs on `cannon-rs` | ||
test-cannon-rs: | ||
# Run Cannon tests | ||
@cd cannon-rs-tests && cargo +nightly test --release | ||
|
||
# Test programs on `asterisc` | ||
test-asterisc: | ||
# Build the programs | ||
@cd ../examples/minimal && just build-asterisc --release | ||
@cd ../examples/simple-revm && just build-asterisc --release | ||
# Run Asterisc tests | ||
@cd asterisc-tests && go test -count=1 -v ./... |
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