chore: pin ubuntu basimage digest #62
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: Build and Release Honeypot | |
| on: [push] | |
| env: | |
| MACHINE_EMULATOR_VERSION: 0.19.0 | |
| XGENEXT2FS_VERSION: 1.5.6 | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| config: [localhost, sepolia, mainnet] | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Buildx setup | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y make lua5.4 wget | |
| - name: Download and install machine-emulator | |
| run: | | |
| wget https://github.com/cartesi/machine-emulator/releases/download/v${{ env.MACHINE_EMULATOR_VERSION }}/machine-emulator_amd64.deb | |
| sudo dpkg -i machine-emulator_amd64.deb || sudo apt-get install -f -y | |
| - name: Download and install xgenext2fs | |
| run: | | |
| wget https://github.com/cartesi/genext2fs/releases/download/v${{ env.XGENEXT2FS_VERSION }}/xgenext2fs_amd64.deb | |
| sudo dpkg -i xgenext2fs_amd64.deb || sudo apt-get install -f -y | |
| - name: Build snapshot for ${{ matrix.config }} | |
| run: make snapshot HONEYPOT_CONFIG=${{ matrix.config }} | |
| - name: Run tests for ${{ matrix.config }} | |
| run: make test HONEYPOT_CONFIG=${{ matrix.config }} | |
| - name: Run stress tests for ${{ matrix.config }} | |
| run: make test-stress HONEYPOT_CONFIG=${{ matrix.config }} | |
| - name: Create artifact archive | |
| run: | | |
| cd snapshot && tar -czf ../honeypot-snapshot-${{ matrix.config }}.tar.gz * && cd .. | |
| sha256sum honeypot-snapshot-${{ matrix.config }}.tar.gz > honeypot-snapshot-${{ matrix.config }}.tar.gz.sha256 | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: honeypot-snapshot-${{ matrix.config }} | |
| path: | | |
| honeypot-snapshot-${{ matrix.config }}.tar.gz | |
| honeypot-snapshot-${{ matrix.config }}.tar.gz.sha256 | |
| retention-days: 30 | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release assets | |
| run: | | |
| mkdir -p release-assets | |
| find artifacts -name "*.tar.gz" -exec cp {} release-assets/ \; | |
| find artifacts -name "*.sha256" -exec cp {} release-assets/ \; | |
| ls -la release-assets/ | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: true | |
| files: release-assets/* | |
| fail_on_unmatched_files: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |