6_rename_bindings #196
Workflow file for this run
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: C Test Suite | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- .github/workflows/*_c.yml | |
- bindings/c/** | |
- src/** | |
- Cargo.lock | |
- Cargo.toml | |
- deny.toml | |
- .gitmodules | |
pull_request: | |
paths: | |
- .github/workflows/*_c.yml | |
- bindings/c/** | |
- src/** | |
- Cargo.lock | |
- Cargo.toml | |
- deny.toml | |
- .gitmodules | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: C test | |
defaults: | |
run: | |
working-directory: bindings/c | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
include: | |
- os: ubuntu-latest | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- uses: dtolnay/rust-toolchain@d0592fe69e35bc8f12e3dbaf9ad2694d976cb8e3 # stable | |
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Run Cargo Clippy | |
run: cargo clippy | |
- name: Run Cargo Fmt | |
run: cargo fmt --check | |
- name: Run Cargo Deny | |
uses: EmbarkStudios/cargo-deny-action@3f4a782664881cf5725d0ffd23969fcce89fd868 # v1.6.3 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Setup Python | |
id: setup-python | |
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
with: | |
python-version: 3 | |
cache: 'pip' | |
- name: Install ninja | |
working-directory: 'scripts' | |
run: python install_package.py ninja | |
- name: Install meson | |
run: python -m pip install .[build] | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Meson Setup | |
run: meson setup build -Dtests=true -Db_coverage=true | |
- name: Meson Compile | |
working-directory: bindings/c/build | |
run: | | |
meson compile | |
- name: Meson Test | |
working-directory: bindings/c/build | |
run: | | |
meson test | |
- name: Run Valgrind | |
working-directory: bindings/c/build | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
sudo apt update | |
sudo apt install -y valgrind | |
valgrind -v --leak-check=full --show-leak-kinds=all tests/test_check | |
valgrind -v --leak-check=full --show-leak-kinds=all tests/test_item | |
valgrind -v --leak-check=full --show-leak-kinds=all tests/test_result | |
valgrind -v --leak-check=full --show-leak-kinds=all tests/test_runner | |
valgrind -v --leak-check=full --show-leak-kinds=all tests/test_status | |
- name: Install LCov | |
working-directory: 'scripts' | |
run: python install_package.py lcov | |
- name: Run LCov | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
working-directory: bindings/c/build | |
run: lcov -c -d . -o coverage.info | |
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 | |
with: | |
flags: lang-c | |
files: build/coverage.info |