Implement Redis storage (#1396) #39
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: Coverage | |
on: | |
push: | |
branches: [main, release-*] | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
branches: [main, release-*] | |
paths-ignore: | |
- 'docs/**' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Read rust-toolchain file | |
id: rust-toolchain | |
run: echo "toolchain=$(cat rust-toolchain)" >> $GITHUB_OUTPUT | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ steps.rust-toolchain.outputs.toolchain }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: rustup component add llvm-tools-preview | |
- name: Redis in GitHub Actions | |
uses: supercharge/[email protected] | |
with: | |
redis-version: 6 | |
- name: Install grcov | |
uses: actions-rs/[email protected] | |
with: | |
crate: grcov | |
version: latest | |
use-tool-cache: true | |
- name: build | |
env: | |
RUSTFLAGS: -Cinstrument-coverage | |
run: cargo build --verbose | |
- name: test | |
env: | |
RUSTFLAGS: -Cinstrument-coverage | |
LLVM_PROFILE_FILE: gluesql-%p-%m.profraw | |
run: cargo test --all-features --verbose | |
- name: Run grcov | |
run: | | |
mkdir coverage | |
grcov . \ | |
--binary-path ./target/debug/ \ | |
-s . \ | |
-t lcov \ | |
--branch \ | |
--ignore-not-existing \ | |
--ignore "/*" \ | |
--ignore "pkg/rust/examples/*.rs" \ | |
--ignore "cli/src/{cli,helper,lib,main}.rs" \ | |
--excl-line "(#\\[derive\\()|(^\s*.await[;,]?$)|(^test_case\!\([\d\w]+,)" \ | |
-o ./coverage/lcov.info | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} |