Skip to content

Build & Test

Build & Test #76

Workflow file for this run

name: Build & Test
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
schedule:
- cron: "23 3 * * *"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
environment: testing
concurrency:
group: testing
env:
SSO_ID: ${{ vars.SSO_ID }}
SSO_PASSWORD: ${{ secrets.SSO_PASSWORD }}
TARGET_YEAR: ${{ vars.TARGET_YEAR }}
TARGET_SEMESTER: ${{ vars.TARGET_SEMESTER }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: Retrieve cache
uses: Leafwing-Studios/cargo-cache@v2
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
version:
- 'Cargo.toml'
- name: Publish dry-run
if: steps.changes.outputs.version == 'true'
run: cargo publish -p rusaint --dry-run --verbose
- name: Generate code coverage
env:
RUST_LOG: info
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: EATSTEAK/rusaint
files: lcov.info
fail_ci_if_error: true