update BooleanExpression variable collection #70
This file contains 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: build | |
# This should ensure that the workflow won't run on `dev-*` branches, but will | |
# otherwise execute on any other branch and any pull request (including PRs | |
# from dev branches). | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- '*' | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_VERSION: "1.82.0" | |
# A fixed version used for testing, so that the builds don't | |
# spontaneously break after a few years. | |
# Make sure to update this from time to time. | |
jobs: | |
# Checks syntax formatting. | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
# Run basic code validity check. | |
check: | |
needs: fmt | |
name: Check | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- run: cargo check --all-features | |
# Run tests. | |
unit_test: | |
needs: check | |
name: Unit Test | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: rustfmt | |
- name: Build | |
run: cargo build --verbose | |
- name: Run Tests | |
run: cargo test --verbose --features __test_runtime_assert --release | |
# Checks code style. | |
clippy: | |
needs: check | |
name: Clippy | |
runs-on: ubuntu-latest | |
# env: | |
# RUSTFLAGS: "-D warnings -A clippy::todo" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: clippy | |
- run: cargo clippy --all-features | |
examples: | |
needs: check | |
name: Run Examples | |
runs-on: ubuntu-latest | |
# env: | |
# RUSTFLAGS: "-D warnings -A clippy::todo" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: clippy | |
- run: cargo run --example 0_parse_fmt | |
- run: cargo run --example 1_parse_fmt_file -- dev/tech/cases/ocv.lib | |
- run: cargo run --example 2_prune_lib -- dev/tech/cases/ocv.lib | |
regression: | |
needs: [unit_test, clippy, examples] | |
name: Regression | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: rustfmt | |
- name: Run Regression | |
# https://www.reddit.com/r/git/comments/1ecplap/how_to_get_the_head_commit_hash_of_a_pr_in_github/#:~:text=If%20you%20want%20to%20get,head. | |
run: echo "TODO ${{ github.event.pull_request.head.sha }}" | |
# Compute code coverage | |
codecov: | |
needs: [unit_test, clippy, examples] | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
# Install action using cargo-binstall, which is faster because we don't have to compile tarpaulin every time. | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-tarpaulin | |
- run: cargo tarpaulin --verbose --release --lib --examples --workspace --exclude liberty-macros --exclude-files dev/* --out xml html --output-dir target/codecov | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
files: target/codecov/cobertura.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |