Skip to content

Update Spire Version Used In Integration Test (#128) #43

Update Spire Version Used In Integration Test (#128)

Update Spire Version Used In Integration Test (#128) #43

Workflow file for this run

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@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-json: ./coveralls.json
- name: Clean up SPIRE
run: .github/workflows/scripts/cleanup-spire.sh