From d181252f88e1dfe050ef13ce27e537f6c798fe89 Mon Sep 17 00:00:00 2001 From: Andrei Tumbar Date: Thu, 25 Jun 2026 08:49:37 -0700 Subject: [PATCH 1/3] CodeCov --- .github/actions-rs/grcov.yml | 2 ++ .github/workflows/codecov.yml | 42 +++++++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 45 insertions(+) create mode 100644 .github/actions-rs/grcov.yml create mode 100644 .github/workflows/codecov.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml new file mode 100644 index 0000000..2ef4c15 --- /dev/null +++ b/.github/actions-rs/grcov.yml @@ -0,0 +1,2 @@ +output-type: lcov +output-file: ./lcov.info diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..2991cd6 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,42 @@ +name: CodeCov Coverage + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + - name: rust-grcov + uses: actions-rs/grcov@v0.1 + - name: Codecov + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + # Repository upload token - get it from codecov.io. Required only for private repositories + # token: # optional + # Specify whether the Codecov output should be verbose + verbose: true + fail_ci_if_error: true diff --git a/README.md b/README.md index 1b1cc9e..8aa51bc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ persons. # SpaceWASM [![CI](https://github.com/nasa/spacewasm/actions/workflows/ci.yml/badge.svg)](https://github.com/nasa/spacewasm/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/nasa/spacewasm/branch/main/graph/badge.svg)](https://codecov.io/gh/nasa/spacewasm) SpaceWASM is an implementation of the [WASM 1.0](https://webassembly.github.io/spec/versions/core/WebAssembly-1.0.pdf) specification meant to interpret WASM binary on-board spacecraft. This software comes with two major components: From 545e7bce84dcccdc36a36e627cff22207ea45129 Mon Sep 17 00:00:00 2001 From: Andrei Tumbar Date: Thu, 25 Jun 2026 08:58:57 -0700 Subject: [PATCH 2/3] LLVM-based code coverage --- .github/workflows/codecov.yml | 63 ++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2991cd6..7029ba9 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,41 +2,44 @@ name: CodeCov Coverage on: push: - branches: [ "main" ] + branches: [main] pull_request: - branches: [ "main" ] + branches: [main] env: CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 jobs: - build: - + coverage: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - - name: rust-grcov - uses: actions-rs/grcov@v0.1 - - name: Codecov - uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - # Repository upload token - get it from codecov.io. Required only for private repositories - # token: # optional - # Specify whether the Codecov output should be verbose - verbose: true - fail_ci_if_error: true + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + + - name: Install WABT (WebAssembly Binary Toolkit) + run: | + WABT_VERSION=1.0.41 + WABT_PLATFORM="linux-x64" + wget https://github.com/WebAssembly/wabt/releases/download/${WABT_VERSION}/wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz + tar -xzf wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz + sudo cp wabt-${WABT_VERSION}/bin/* /usr/local/bin/ + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate coverage + run: cargo llvm-cov --package spacewasm --lcov --output-path lcov.info + + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true From 0884dfa73c8d905b36d299057dae110527bef96f Mon Sep 17 00:00:00 2001 From: Andrei Tumbar Date: Thu, 25 Jun 2026 09:00:57 -0700 Subject: [PATCH 3/3] Clean up the CI --- .github/actions-rs/grcov.yml | 2 -- .github/workflows/ci.yml | 2 ++ .github/workflows/codecov.yml | 45 ----------------------------------- 3 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 .github/actions-rs/grcov.yml delete mode 100644 .github/workflows/codecov.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml deleted file mode 100644 index 2ef4c15..0000000 --- a/.github/actions-rs/grcov.yml +++ /dev/null @@ -1,2 +0,0 @@ -output-type: lcov -output-file: ./lcov.info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2f0c82..afd1037 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -430,4 +430,6 @@ jobs: uses: codecov/codecov-action@v4 with: files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false + verbose: true diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 7029ba9..0000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: CodeCov Coverage - -on: - push: - branches: [main] - pull_request: - branches: [main] - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: 1 - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: llvm-tools-preview - - - name: Install WABT (WebAssembly Binary Toolkit) - run: | - WABT_VERSION=1.0.41 - WABT_PLATFORM="linux-x64" - wget https://github.com/WebAssembly/wabt/releases/download/${WABT_VERSION}/wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz - tar -xzf wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz - sudo cp wabt-${WABT_VERSION}/bin/* /usr/local/bin/ - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Generate coverage - run: cargo llvm-cov --package spacewasm --lcov --output-path lcov.info - - - name: Upload to Codecov - uses: codecov/codecov-action@v4 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true