Skip to content

Make configuration directory configurable #147

Make configuration directory configurable

Make configuration directory configurable #147

Workflow file for this run

# Copyright (C) 2022-2024 Daniel Mueller <deso@posteo.net>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Test
on:
pull_request:
push:
workflow_call:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Build without debug information enabled to decrease compilation time
# and binary sizes in CI. This option is assumed to only have marginal
# effects on the generated code, likely only in terms of section
# arrangement. See
# https://doc.rust-lang.org/cargo/reference/environment-variables.html
# https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo
RUSTFLAGS: '-C debuginfo=0'
jobs:
build:
name: Build [${{ matrix.rust }}, ${{ matrix.profile }}]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.65.0, stable]
profile: [dev, release]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build ${{ matrix.profile }}
run: |
cargo build --profile=${{ matrix.profile }} --bins --tests --examples --features=test
test:
name: Test and coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Test and gather coverage
# We lack a TTY, so we hack one with `script`.
shell: script --quiet --return --command "bash --noprofile --norc -e -o pipefail {0}"
run:
cargo llvm-cov --lcov --output-path lcov.info --features=test
- name: Upload code coverage results
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
bench:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: |
echo '```' >> $GITHUB_STEP_SUMMARY
cargo bench --features=nightly --quiet -- bench_ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo clippy --no-deps --tests -- -A unknown_lints -D warnings
cargo clippy --no-deps --features=readline -- -A unknown_lints -D warnings