Skip to content

build: bump airlayer to latest main (b8c734d) (#2170) #316

build: bump airlayer to latest main (b8c734d) (#2170)

build: bump airlayer to latest main (b8c734d) (#2170) #316

Workflow file for this run

name: Coverage
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
workflow_dispatch:
permissions:
contents: read
actions: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_LOG: debug
# line-tables-only debug: sufficient for llvm-cov, ~60% smaller than default debug = 2
CARGO_PROFILE_DEV_DEBUG: "1"
defaults:
run:
shell: bash
jobs:
changesets:
uses: ./.github/workflows/changesets.yaml
if: github.repository == 'oxy-hq/oxy'
name: Changesets
permissions:
contents: write
actions: read
pull-requests: read
coverage:
name: Code Coverage
needs: [changesets]
# Only run on oxy-hq/oxy main branch and when oxy code has changed
if: github.repository == 'oxy-hq/oxy' && github.ref == 'refs/heads/main' && needs.changesets.outputs.oxy == 'true'
runs-on: "ubuntu-latest"
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
BIGQUERY_SAMPLE_KEY: ${{ secrets.BIGQUERY_SAMPLE_KEY }}
GEMINI_API_KEY: "empty"
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
services:
postgres:
image: postgres:18-alpine
env:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: default
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U admin -d default"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
# - name: Free disk space
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: false
# android: true
# dotnet: true
# haskell: true
# large-packages: true
# docker-images: true
# swap-storage: true
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
metric_frequency: 3
comment_on_pr: false
- uses: rui314/setup-mold@v1
if: runner.os == 'Linux'
with:
make-default: true
- name: Prep Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt, llvm-tools-preview
- name: Install cargo tools
uses: taiki-e/install-action@v2
with:
tool: nextest,cargo-llvm-cov
- name: Prep cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: coverage
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Wait for Postgres
run: |
until pg_isready -h localhost -p 5432 -U admin; do
echo "Waiting for Postgres..."
sleep 2
done
echo "Postgres is ready!"
env:
PGPASSWORD: password
- name: Run coverage
env:
OXY_DATABASE_URL: "postgresql://admin:password@localhost:5432/default"
OXY_BIN: "${{ github.workspace }}/target/llvm-cov-target/ci/oxy"
run: |
touch examples/bigquery-sample.key
echo $BIGQUERY_SAMPLE_KEY > examples/bigquery-sample.key
# Run migrations using instrumented binary — same profile as nextest (ci) to avoid double compilation
cargo llvm-cov run --profile ci -- migrate
# Run tests reusing the instrumented build from above (--no-clean preserves migrate profraw)
cargo llvm-cov nextest --cargo-profile ci --workspace --no-clean --lcov --output-path lcov.info --no-fail-fast
# Print coverage summary
cargo llvm-cov report --profile ci --summary-only
./target/llvm-cov-target/ci/oxy gen-config-schema --check
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info