|
| 1 | +name: Project integration tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + # Build images and publish as artifacts |
| 14 | + build: |
| 15 | + name: Build images |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + |
| 22 | + - name: Set up Docker Buildx |
| 23 | + uses: docker/setup-buildx-action@v2 |
| 24 | + |
| 25 | + - name: Set up Rust |
| 26 | + uses: actions/setup-rust@v1 |
| 27 | + |
| 28 | + - name: Install Just |
| 29 | + uses: taiki-e/install-action@just |
| 30 | + |
| 31 | + - name: Build Docker images |
| 32 | + run: | |
| 33 | + just build |
| 34 | + |
| 35 | + - name: Save Docker images to tarballs |
| 36 | + run: | |
| 37 | + mkdir -p artifacts |
| 38 | + just ci export-images $(realpath ./artifacts) |
| 39 | +
|
| 40 | + - name: Upload images artifacts |
| 41 | + uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: based-op-images |
| 44 | + path: artifacts |
| 45 | + |
| 46 | + # Use published artifacts and run nodes |
| 47 | + test: |
| 48 | + name: Configure nodes & run tests |
| 49 | + runs-on: ubuntu-latest |
| 50 | + needs: build |
| 51 | + env: |
| 52 | + BASED_ENV: dev |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + fetch-depth: 0 |
| 57 | + |
| 58 | + - name: Install Just |
| 59 | + uses: taiki-e/install-action@just |
| 60 | + |
| 61 | + - name: Set up Foundry (for Ethereum tests) |
| 62 | + uses: foundry-rs/setup-foundry@v1 |
| 63 | + with: |
| 64 | + version: latest |
| 65 | + |
| 66 | + - name: Download images artifacts |
| 67 | + uses: actions/download-artifact@v4 |
| 68 | + with: |
| 69 | + name: based-op-images |
| 70 | + path: ./artifacts |
| 71 | + |
| 72 | + - name: Load Docker images |
| 73 | + run: | |
| 74 | + set -euo pipefail |
| 75 | + find ./artifacts -f -exec gunzip -c {} | docker load \; |
| 76 | +
|
| 77 | + - name: Prepare configuration |
| 78 | + run: | |
| 79 | + set -euo pipefail |
| 80 | + just ci prepare |
| 81 | +
|
| 82 | + - name: Publish configuration artifact |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: config |
| 86 | + path: | |
| 87 | + .local/ |
| 88 | +
|
| 89 | + - name: Start Based OP services |
| 90 | + run: | |
| 91 | + set -euo pipefail |
| 92 | + just ci run |
| 93 | +
|
| 94 | + - name: Run tests |
| 95 | + run: | |
| 96 | + set -euo pipefail |
| 97 | + just ci test |
| 98 | + |
| 99 | + - run: | |
| 100 | + just ci stop |
0 commit comments