Skip to content

Integration Testing Receipt Indexing (Part 1) #2425

Integration Testing Receipt Indexing (Part 1)

Integration Testing Receipt Indexing (Part 1) #2425

Workflow file for this run

on:
pull_request:
push:
branches:
- main
name: Check, Test, and Format
jobs:
base:
name: build base
runs-on: ['hostname:hetzner-dedicated-6']
outputs:
RUNNER: ${{ steps.get-label.outputs.runner_name }}
steps:
- name: Get Runner Label
id: get-label
run: |
if [[ "${{ runner.name }}" == *"@hetzner-dedicated-6" ]]; then
echo "runner_name=hostname:hetzner-dedicated-6" >> $GITHUB_OUTPUT
else
echo "runner_name=nix-128g" >> $GITHUB_OUTPUT
fi
- name: Cleanup docker build cache
run: |
docker system prune --force
docker builder prune --all --force
- name: Checkout code
uses: actions/checkout@v4
- name: Build base
env:
DOCKER_BUILDKIT: 1
run: |
docker build --tag base --file docker/base/Dockerfile . --platform linux/amd64 --build-arg INSTRUCTION_SET="x86-64-v3"
clippy-fmt-check:
needs: base
runs-on: ${{needs.base.outputs.RUNNER}}
steps:
- name: clippy
run: |
docker run --rm base cargo clippy --all-targets --all -- -D warnings -A incomplete-features -A clippy::needless_return -A clippy::too_long_first_doc_paragraph -A clippy::await_holding_lock
- name: fmt
run: |
docker run --rm base cargo fmt --all -- --check
- name: check
run: |
docker run --rm base cargo check --tests
test:
name: Test Suite
runs-on: ['nix-128g']
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Generate a random port number
run: echo PGSQL_PORT=$(shuf -i 5000-30000 -n1) > .env
- name: Install foundry
shell: devenv shell bash -- -e {0}
run: cargo install --root ${HOME}/.cargo --git https://github.com/foundry-rs/foundry --rev c4a984f forge anvil
- name: Put cargo in PATH
shell: devenv shell bash -- -e {0}
run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
- name: Run cargo test
run: devenv test
env:
RUST_LOG: "info"
RUST_MIN_STACK: 10485760
CI_RPC_URL: ${{ secrets.CI_RPC_URL }}
CI_SEPOLIA: ${{ secrets.CI_SEPOLIA }}
CI_ETH: ${{ secrets.CI_ETH }}
LPN_PARAMS_DIR: $HOME/ci_params/
LPN_PARAMS_REBUILD: "true"