diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02a6faea..36aaba9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,36 @@ jobs: - name: Run Tests run: cargo test --manifest-path ${{ env.MANIFEST_PATH }} + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache Cargo Registry & Build Artifacts + uses: Swatinem/rust-cache@v2 + + - name: Install cargo-binstall + uses: cargo-bins/cargo-binstall@main + + - name: Install cargo-tarpaulin + run: cargo binstall cargo-tarpaulin --no-confirm + + - name: Run Tarpaulin + run: cargo tarpaulin --out Xml --all-features --workspace + + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + files: cobertura.xml + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + build: name: Build WASM runs-on: ubuntu-latest diff --git a/.tarpaulin.toml b/.tarpaulin.toml new file mode 100644 index 00000000..422814c3 --- /dev/null +++ b/.tarpaulin.toml @@ -0,0 +1,11 @@ +[default] +exclude-files = [ + "*/tests/*", + "*/test_*", + "*_test.rs", + "*/proptest-regressions/*", +] +exclude = [ + "soroban_sdk", + "soroban_env_host", +]