chore: rustfmt and 'docker-compose' on the CI action #40
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: Code Coverage | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
code-coverage: | |
permissions: | |
contents: write | |
env: | |
CARGO_INCREMENTAL: '0' | |
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | |
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use nightly toolchain | |
run: | | |
rustup toolchain install nightly | |
rustup override set nightly | |
- name: Make the USER own the working directory. Installing `gssapi` headers | |
run: | | |
sudo chown -R $USER:$USER ${{ github.workspace }} | |
sudo apt -y install gcc libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit | |
- name: Caching cargo dependencies | |
id: project-cache | |
uses: Swatinem/rust-cache@v2 | |
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} | |
name: Install grcov | |
run: cargo install grcov | |
- name: Make the USER own the working directory | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sudo chown -R $USER:$USER ${{ github.workspace }} | |
- name: Waking up docker | |
run: docker-compose -f ./docker/docker-compose.yml up -d | |
- name: Run tests | |
run: | | |
cargo test initialize_sql_server_docker_instance -p tests --all-features --no-fail-fast -- --show-output --nocapture --include-ignored | |
cargo test --all-features --no-fail-fast --target=x86_64-unknown-linux-gnu -- --show-output --test-threads=1 | |
- name: Waking up docker | |
run: | | |
docker-compose -f ./docker/docker-compose.yml down | |
sudo chown -R $USER:$USER ${{ github.workspace }} | |
rm -rf ./docker/postgres-data | |
- name: Generate code coverage report | |
run: | | |
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage | |
- name: Publish Test Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Unit Test Results | |
path: | | |
./target/debug/coverage/index.html | |
- name: Publish coverage report to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: ./target/debug/coverage | |
token: ${{ secrets.GITHUB_TOKEN }} |