Skip to content

Update AGENTS.md - remind to run relevant tests (#1752) #43

Update AGENTS.md - remind to run relevant tests (#1752)

Update AGENTS.md - remind to run relevant tests (#1752) #43

Workflow file for this run

name: Coverage
on:
push:
branches: [main, release-*]
paths-ignore:
- "docs/**"
pull_request:
branches: [main]
paths-ignore:
- "docs/**"
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- run: rustup component add llvm-tools-preview
- run: cargo install grcov
- name: clean
run: |
cargo clean
rm -rf ./target/debug/deps/gluesql*
rm *.profraw && rm **/*.profraw
cd storages/csv-storage && rm -rf ./tmp && cd ../..
cd storages/json-storage && rm -rf ./tmp && cd ../..
redis-cli flushall
- name: build
env:
RUSTFLAGS: -Cinstrument-coverage
run: cargo build --verbose
- name: test
env:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: gluesql-%p-%m.profraw
GIT_REMOTE: https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
run: GIT_REMOTE=$GIT_REMOTE 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: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: rust
fail_ci_if_error: true
- name: Coveralls
continue-on-error: true
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}