fix: pin strfry image and fix health check in CI #27
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: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - run: cargo fmt --check | |
| - run: cargo check --all-targets | |
| - run: cargo clippy --all-targets -- -W clippy::all -W clippy::pedantic -D warnings | |
| - name: Check unused dependencies | |
| uses: taiki-e/install-action@70e00552f3196d9a4c7dde7c57ef4c4830d422dd # v2.68.2 | |
| with: | |
| tool: cargo-machete | |
| - run: cargo machete | |
| audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - name: Install cargo-audit | |
| uses: taiki-e/install-action@70e00552f3196d9a4c7dde7c57ef4c4830d422dd # v2.68.2 | |
| with: | |
| tool: cargo-audit | |
| - run: cargo audit | |
| zizmor: | |
| name: Actions Security | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install zizmor | |
| run: pip install zizmor | |
| - run: zizmor --no-online-audits . | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Install nextest | |
| uses: taiki-e/install-action@70e00552f3196d9a4c7dde7c57ef4c4830d422dd # v2.68.2 | |
| with: | |
| tool: cargo-nextest | |
| - run: cargo nextest run | |
| integration-test: | |
| name: Integration Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Install nextest | |
| uses: taiki-e/install-action@70e00552f3196d9a4c7dde7c57ef4c4830d422dd # v2.68.2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Start strfry relay | |
| run: | | |
| IMAGE="ghcr.io/hoytech/strfry@sha256:7cf3b97c66a8c3087e16e5d31a3bb8eb92312f08dd969ff3dced9625242ac55f" | |
| docker run -d --name strfry -p 7777:7777 \ | |
| -v "${{ github.workspace }}/.github/strfry-ci.conf:/app/strfry.conf:ro" \ | |
| --tmpfs /app/strfry-db \ | |
| "$IMAGE" relay | |
| - name: Wait for strfry | |
| run: | | |
| for i in $(seq 1 30); do | |
| STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7777 2>/dev/null || true) | |
| if [ "$STATUS" != "000" ] && [ -n "$STATUS" ]; then | |
| echo "strfry is ready (HTTP $STATUS)" | |
| exit 0 | |
| fi | |
| echo "Waiting for strfry... ($i/30)" | |
| sleep 1 | |
| done | |
| echo "strfry failed to start" | |
| docker logs strfry | |
| exit 1 | |
| - name: Run integration tests | |
| run: cargo nextest run --run-ignored ignored-only | |
| env: | |
| WOKHEI_RELAY: ws://localhost:7777 |