ci: add new tests to CI #121
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| rust: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| lua5.4 \ | |
| liblua5.4-dev \ | |
| libslirp-dev | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: v1.4.3 | |
| - name: Check | |
| run: cargo check --workspace --all-targets --locked | |
| - name: Build | |
| run: cargo build --workspace --all-targets --locked | |
| - name: Format | |
| run: cargo fmt --all -- --check | |
| - name: Test | |
| timeout-minutes: 15 | |
| run: RUN_ANVIL_TESTS=1 cargo test --workspace --all-targets --all-features --locked | |
| canonical-guest: | |
| runs-on: ubuntu-latest | |
| needs: rust | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| lua5.4 \ | |
| liblua5.4-dev \ | |
| libslirp-dev \ | |
| ca-certificates \ | |
| wget \ | |
| xz-utils | |
| - name: Install xgenext2fs | |
| run: | | |
| set -euo pipefail | |
| ARCH="$(dpkg --print-architecture)" | |
| VERSION="v1.5.5" | |
| case "${ARCH}" in | |
| amd64) | |
| DEB_SHA256="e42857c454a772553e2bec5e73ac499b39d35dbf622bdb4cbb1b19fe98f62999" | |
| ;; | |
| arm64) | |
| DEB_SHA256="a9964903e9d4c1006dc9d88b4823be14d2eccaf66007c48e76c883e17db2880c" | |
| ;; | |
| *) | |
| echo "unsupported arch for xgenext2fs: ${ARCH}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| wget -O /tmp/xgenext2fs.deb "https://github.com/cartesi/genext2fs/releases/download/${VERSION}/xgenext2fs_${ARCH}.deb" | |
| echo "${DEB_SHA256} /tmp/xgenext2fs.deb" | sha256sum --check | |
| sudo apt-get update | |
| sudo apt-get install -y /tmp/xgenext2fs.deb | |
| - name: Install cartesi-machine (machine emulator CLI) | |
| run: | | |
| set -euo pipefail | |
| ARCH="$(dpkg --print-architecture)" | |
| VERSION="v0.20.0-test2" | |
| case "${ARCH}" in | |
| amd64) | |
| DEB_SHA256="39bbfc96a6cc6606307294b719df65f4f2725e8d200d062bcbd8c22355b99b56" | |
| ;; | |
| arm64) | |
| DEB_SHA256="787d823756000cdecd72da8a3494b4c08613087379035959e561bbaef7a220ba" | |
| ;; | |
| *) | |
| echo "unsupported arch for machine-emulator: ${ARCH}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| wget -O /tmp/machine-emulator.deb "https://github.com/cartesi/machine-emulator/releases/download/${VERSION}/machine-emulator_${ARCH}.deb" | |
| echo "${DEB_SHA256} /tmp/machine-emulator.deb" | sha256sum --check | |
| sudo apt-get update | |
| sudo apt-get install -y /tmp/machine-emulator.deb | |
| cartesi-machine --version | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install just | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - name: Install cross | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cross | |
| - name: Download canonical app deps | |
| run: just -f examples/canonical-app/justfile download-deps | |
| - name: Run guest tests | |
| run: just canonical-test-guest | |
| rollups-e2e: | |
| runs-on: ubuntu-latest | |
| needs: rust | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| lua5.4 \ | |
| liblua5.4-dev \ | |
| libslirp-dev \ | |
| ca-certificates \ | |
| wget \ | |
| xz-utils | |
| - name: Install xgenext2fs | |
| run: | | |
| set -euo pipefail | |
| ARCH="$(dpkg --print-architecture)" | |
| VERSION="v1.5.5" | |
| case "${ARCH}" in | |
| amd64) | |
| DEB_SHA256="e42857c454a772553e2bec5e73ac499b39d35dbf622bdb4cbb1b19fe98f62999" | |
| ;; | |
| arm64) | |
| DEB_SHA256="a9964903e9d4c1006dc9d88b4823be14d2eccaf66007c48e76c883e17db2880c" | |
| ;; | |
| *) | |
| echo "unsupported arch for xgenext2fs: ${ARCH}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| wget -O /tmp/xgenext2fs.deb "https://github.com/cartesi/genext2fs/releases/download/${VERSION}/xgenext2fs_${ARCH}.deb" | |
| echo "${DEB_SHA256} /tmp/xgenext2fs.deb" | sha256sum --check | |
| sudo apt-get update | |
| sudo apt-get install -y /tmp/xgenext2fs.deb | |
| - name: Install cartesi-machine (machine emulator CLI) | |
| run: | | |
| set -euo pipefail | |
| ARCH="$(dpkg --print-architecture)" | |
| VERSION="v0.20.0-test2" | |
| case "${ARCH}" in | |
| amd64) | |
| DEB_SHA256="39bbfc96a6cc6606307294b719df65f4f2725e8d200d062bcbd8c22355b99b56" | |
| ;; | |
| arm64) | |
| DEB_SHA256="787d823756000cdecd72da8a3494b4c08613087379035959e561bbaef7a220ba" | |
| ;; | |
| *) | |
| echo "unsupported arch for machine-emulator: ${ARCH}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| wget -O /tmp/machine-emulator.deb "https://github.com/cartesi/machine-emulator/releases/download/${VERSION}/machine-emulator_${ARCH}.deb" | |
| echo "${DEB_SHA256} /tmp/machine-emulator.deb" | sha256sum --check | |
| sudo apt-get update | |
| sudo apt-get install -y /tmp/machine-emulator.deb | |
| cartesi-machine --version | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: v1.4.3 | |
| - name: Install just | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - name: Install cross | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cross | |
| - name: Run rollups E2E tests | |
| run: just test-rollups-e2e |