Skip to content

KMS

KMS #29

Workflow file for this run

name: twmq Coverage
on:
push:
branches: [main]
paths:
- "twmq/**"
pull_request:
branches: [main]
paths:
- "twmq/**"
workflow_dispatch: # Allow manual triggering for testing (optional)
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Give GitHub Actions access to @thirdweb-dev/vault
uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd #@v0.9.1
with:
ssh-private-key: ${{ secrets.VAULT_REPO_DEPLOY_KEY }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #checkout@v4
- name: Install CI dependencies
uses: taiki-e/install-action@9185c192a96ba09167ad8663015b3fbbf007ec79 #@2.56.2
with:
tool: cargo-tarpaulin
- name: Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-tarpaulin-${{ hashFiles('**/Cargo.lock') }}
# Run coverage with tarpaulin
- name: Run coverage
run: cargo tarpaulin -p twmq --skip-clean --out Xml --out Html --output-dir coverage --exclude-files "aa-core/*" --exclude-files "core/*" --exclude-files "server/*" --exclude-files "thirdweb-core/*" --exclude-files "executors/*"
# Upload coverage to Codecov
# TODO: Uncomment once we have open-sourced the repo
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # @5.4.2
# with:
# files: coverage/cobertura.xml
# fail_ci_if_error: false
# flags: integration
# name: integration-tests
# verbose: true
# env:
# CODECOV_ENV: RUST,CARGO
# Archive coverage reports as artifacts
- name: Archive code coverage results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # @4.6.2
with:
name: code-coverage-report
path: coverage/
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # @v1.3.0
with:
filename: coverage/cobertura.xml
format: markdown
output: both
- name: Add Coverage Summary to Job Summary
# This step reads the generated markdown file and appends it to the
# special GITHUB_STEP_SUMMARY file, which populates the job summary page.
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY