Bump actions/checkout from 4.2.1 to 4.2.2 (#125) #40
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 ] | |
workflow_dispatch: | |
jobs: | |
coverage: | |
name: Run tests and generate coverage report | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-Cinstrument-coverage" | |
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw" | |
SPIFFE_ENDPOINT_SOCKET: unix:/tmp/spire-agent/public/api.sock | |
SPIRE_ADMIN_ENDPOINT_SOCKET: unix:/tmp/spire-agent/admin/api.sock | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: recursive | |
- name: Cache Project | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5 | |
- name: Install toolchain | |
uses: ./.github/actions/setup-env | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: install LLVM | |
run: rustup component add llvm-tools-preview | |
- name: Install grcov | |
run: cargo install grcov | |
- name: Start SPIRE | |
run: .github/workflows/scripts/run-spire.sh & | |
- name: Run Tests | |
run: cargo test --all-features | |
- name: Generate Coveralls JSON Report | |
run: | | |
grcov . \ | |
--binary-path ./target/debug/ -t coveralls -s . \ | |
--token ${{ secrets.COVERALLS_TOKEN }} \ | |
--ignore-not-existing \ | |
--ignore "$HOME/.cargo/**" \ | |
--ignore "*/proto/*" \ | |
--ignore "*/spire-api-sdk/*" \ | |
--ignore "*/build.rs" \ | |
--keep-only '*/src/*' > coveralls.json | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@4cdef0b2dbe0c9aa26bed48edb868db738625e79 # v2.3.3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-json: ./coveralls.json | |
- name: Clean up SPIRE | |
run: .github/workflows/scripts/cleanup-spire.sh |