✨ fpvm tests in CI #28
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: 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 | |
cache-directories: | | |
examples/minimal/target | |
examples/simple-revm/target | |
- 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 | |
- uses: Swatinem/rust-cache@v2 | |
if: contains(matrix.fpvm, 'cannon-rs') | |
with: | |
cache-on-failure: true | |
cache-directories: | | |
fpvm-tests/cannon-rs-tests/target | |
- name: Setup Go toolchain | |
if: "!contains(matrix.fpvm , 'cannon-rs')" | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21.6" | |
cache-dependency-path: | | |
fpvm-tests/asterisc-tests | |
fpvm-tests/cannon-tests | |
- 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: | | |
mv minimal/target examples/minimal | |
mv simple-revm/target examples/simple-revm | |
- name: Run FPVM tests | |
working-directory: ./fpvm-tests | |
run: just test-${{ matrix.fpvm }} |