chore(test): fix dockered environment build #1344
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: Build | |
| on: | |
| push: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| prt-contracts: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install Cartesi Machine | |
| uses: ./.github/actions/cartesi-machine | |
| with: | |
| version: 0.19.0 | |
| suffix-version: "" | |
| - name: Setup env | |
| run: | | |
| just setup-local | |
| - name: Build, format check and test prt contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just check-fmt | |
| just build-smart-contracts | |
| just test-disputes | |
| just test-stf | |
| dave-contracts: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Download PRT contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| - name: Download Rollups contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| - name: Build, format check and test Dave consensus contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just check-fmt | |
| just build-smart-contracts | |
| just test | |
| prt-honeypot: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install Cartesi Machine | |
| uses: ./.github/actions/cartesi-machine | |
| with: | |
| version: 0.19.0 | |
| - name: Download PRT contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| - name: Download Rollups contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| - name: Build devnet | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just build-devnet | |
| - name: Download deps | |
| working-directory: ./test/programs/ | |
| run: | | |
| just download-deps | |
| - name: Rust build | |
| run: | | |
| just build | |
| - name: Build honeypot | |
| working-directory: ./test/programs/ | |
| run: | | |
| just build-honeypot-snapshot | |
| - name: Test prt-rollups | |
| timeout-minutes: 20 | |
| run: | | |
| just test-rollups-honeypot-ci | |
| - name: Show failing log | |
| if: failure() | |
| run: | | |
| echo '▼▼▼ failing-step dave.log ▼▼▼' | |
| cat ./prt/tests/rollups/dave.log | |
| echo '▲▲▲ end log ▲▲▲' | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| - name: Install dependencies | |
| env: | |
| XGENEXT2_VERSION: 1.5.6 | |
| ARCH: amd64 | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y --no-install-recommends \ | |
| build-essential git wget \ | |
| libslirp-dev \ | |
| libclang-dev \ | |
| liblua5.4-dev lua5.4 \ | |
| xxd jq sqlite3 libc6 clang libarchive13 | |
| wget -O xgenext2fs.deb https://github.com/cartesi/genext2fs/releases/download/v${XGENEXT2_VERSION}/xgenext2fs_${ARCH}.deb | |
| sudo apt-get install -y ./xgenext2fs.deb | |
| rm ./xgenext2fs.deb | |
| xgenext2fs --version | |
| - name: Install Cartesi Machine | |
| working-directory: ./machine/emulator | |
| run: | | |
| make bundle-boost | |
| wget -O add-generated-files.diff https://github.com/cartesi/machine-emulator/releases/download/v0.19.0/add-generated-files.diff | |
| echo "a892e2d9f5c331f5e80bcb5db4133e7db625aa4d14ffdf9467b75c4c34d1744f add-generated-files.diff" | sha256sum -c | |
| git apply add-generated-files.diff | |
| rm add-generated-files.diff | |
| make | |
| sudo make install | |
| - name: Setup env | |
| run: | | |
| just setup-local | |
| - name: Rust fmt and check | |
| run: | | |
| just check-fmt-rust-workspace | |
| just check-rust-workspace | |
| - name: Rust build | |
| run: | | |
| just build | |
| - name: Rust test workspace | |
| run: | | |
| just test-rust-workspace | |
| build-release-node: | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| target: x86_64-unknown-linux-gnu | |
| os: ubuntu-24.04 | |
| - arch: arm64 | |
| target: aarch64-unknown-linux-gnu | |
| os: ubuntu-24.04-arm | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ${{ matrix.os }} | |
| container: | |
| image: rust:1.90-bookworm | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y --no-install-recommends \ | |
| build-essential git wget curl \ | |
| liblua5.4-dev lua5.4 \ | |
| libslirp-dev libboost1.81-dev \ | |
| libclang-dev \ | |
| xxd jq sqlite3 | |
| - name: Install dependency for ARM | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| apt-get install -y --no-install-recommends \ | |
| g++-aarch64-linux-gnu | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| with: | |
| setup-qemu: false | |
| setup-rust: false | |
| - name: Contracts | |
| run: | | |
| just -f test/programs/justfile download-deps | |
| just -f prt/contracts/justfile install-deps | |
| just -f cartesi-rollups/contracts/justfile install-deps | |
| just build-smart-contracts | |
| just bind | |
| - name: Cartesi Machine Sys | |
| working-directory: machine/rust-bindings | |
| run: | | |
| cargo build --release -p cartesi-machine-sys --features download_uarch --target ${{ matrix.target }} | |
| - name: Build release | |
| run: | | |
| cargo build --release -p cartesi-rollups-prt-node --target ${{ matrix.target }} | |
| cp -v ./target/${{ matrix.target }}/release/cartesi-rollups-prt-node cartesi-rollups-prt-node | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cartesi-rollups-prt-node-linux-${{ matrix.arch }} | |
| path: | | |
| ./cartesi-rollups-prt-node | |
| if-no-files-found: error | |
| retention-days: 1 | |
| release-node: | |
| needs: [prt-contracts, dave-contracts, prt-honeypot, build, build-release-node] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| - arch: arm64 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create directory | |
| run: mkdir -p upload | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cartesi-rollups-prt-node-linux-${{ matrix.arch }} | |
| - name: Change node binary file permissions | |
| run: chmod 755 cartesi-rollups-prt-node | |
| - name: Compress node binary | |
| run: tar -czf "$FILEPATH" cartesi-rollups-prt-node | |
| env: | |
| FILEPATH: upload/cartesi-rollups-prt-${{ steps.extract_version.outputs.version }}-node-${{ matrix.arch }}.tar.gz | |
| - name: Upload assets to release on GitHub | |
| run: gh release upload "$TAG" upload/* --clobber | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| release-contracts: | |
| needs: [prt-contracts, dave-contracts, prt-honeypot, build] | |
| runs-on: ubuntu-24.04 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create directory | |
| run: | | |
| mkdir -p upload | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Setup tools | |
| uses: ./.github/actions/setup-tools | |
| id: setup | |
| - name: Build PRT Core contracts | |
| working-directory: ./prt/contracts | |
| run: | | |
| just install-deps | |
| forge clean | |
| forge build src | |
| - name: Build Cartesi Rollups PRT contracts | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just install-deps | |
| forge clean | |
| forge build src | |
| - name: Compress contract artifacts | |
| run: tar -czf "$FILEPATH" prt/contracts/out cartesi-rollups/contracts/out | |
| env: | |
| FILEPATH: upload/cartesi-rollups-prt-${{ steps.extract_version.outputs.version }}-contract-artifacts.tar.gz | |
| - name: Build devnet | |
| working-directory: ./cartesi-rollups/contracts | |
| run: | | |
| just build-devnet | |
| - name: Compress devnet artifacts | |
| run: tar -czf "$FILEPATH" -C cartesi-rollups/contracts deployments state.json | |
| env: | |
| FILEPATH: upload/cartesi-rollups-prt-${{ steps.extract_version.outputs.version }}-anvil-${{ steps.setup.outputs.installed-foundry-version }}.tar.gz | |
| - name: Upload assets to release on GitHub | |
| run: gh release upload "$TAG" upload/* --clobber | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} |