Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

fix: failing test, read config from str instead #55

fix: failing test, read config from str instead

fix: failing test, read config from str instead #55

name: "Rust: Build, Test, Publish Coverage"
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches: ["*"]
# Auto-abort duplicate jobs (e.g. job being triggered again on push to open PR)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ikalnytskyi/action-setup-postgres@v6
with:
username: sonata
password: sljkdhfghjklsdfghjkldfsghjklsdfghjklsdfg
database: sonata
port: 5432
id: postgres
- uses: dtolnay/rust-toolchain@nightly
with:
components: "llvm-tools-preview"
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
with:
cache-all-crates: "true"
- uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb
with:
tool: cargo-nextest,cargo-binstall
- name: Install dependencies
run: |
cargo binstall --no-confirm --force --only-signed cargo-llvm-cov sqlx-cli
- name: Apply migrations
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
run: cargo sqlx migrate run
- name: Build, Test, Publish Coverage
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
run: |
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
mkdir -p coverage
cargo +nightly llvm-cov nextest --lcov --output-path coverage/lcov.info --branch --all-targets --all-features --workspace
else
echo "Code Coverage step is skipped on PRs from forks."
cargo nextest run --verbose --all-features
fi
- name: Publish coverage to Coveralls.io
if: github.repository == 'polyphony-chat/sonata'
uses: coverallsapp/github-action@v2
with:
file: "coverage/lcov.info"
format: "lcov"