docs: clarify project scope #4549
Workflow file for this run
This file contains hidden or 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: | |
| pull_request: | |
| push: | |
| branches: main | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_PROFILE_DEV_DEBUG: 1 | |
| CARGO_PROFILE_RELEASE_DEBUG: 1 | |
| RUST_BACKTRACE: short | |
| CARGO_NET_RETRY: 10 | |
| RUSTUP_MAX_RETRIES: 10 | |
| jobs: | |
| changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| specs: ${{ steps.filter.outputs.specs }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - 'code/**' | |
| specs: | |
| - 'specs/**' | |
| codecov: | |
| - 'codecov.yml' | |
| integration: | |
| name: Integration | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || needs.changes.outputs.codecov == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| env: | |
| CARGO_TERM_COLOR: always | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly-2025-01-07 # pin to working nightly | |
| components: llvm-tools-preview | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@cargo-nextest | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate code coverage | |
| run: | | |
| cargo llvm-cov nextest \ | |
| --workspace \ | |
| --exclude informalsystems-malachitebft-test-mbt \ | |
| --exclude informalsystems-malachitebft-starknet-test-mbt \ | |
| --ignore-filename-regex crates/cli \ | |
| --all-features \ | |
| --no-capture \ | |
| --ignore-run-fail \ | |
| --codecov \ | |
| --output-path coverage-integration.info | |
| - name: Generate text report | |
| run: cargo llvm-cov report | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: integration-coverage | |
| path: code/coverage-integration.info | |
| retention-days: 1 | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: integration | |
| fail_ci_if_error: false | |
| mbt: | |
| name: MBT | |
| needs: changes | |
| if: ${{ needs.changes.outputs.code == 'true' || needs.changes.outputs.specs == 'true' || needs.changes.outputs.codecov == 'true' || github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: code | |
| env: | |
| CARGO_TERM_COLOR: always | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Protoc | |
| uses: step-security/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install Quint | |
| run: npm install -g @informalsystems/quint | |
| - name: Setup Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly-2025-01-07 # pin to working nightly | |
| components: llvm-tools-preview | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@cargo-nextest | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate code coverage | |
| run: | | |
| cargo llvm-cov nextest \ | |
| -p informalsystems-malachitebft-test-mbt \ | |
| -p informalsystems-malachitebft-starknet-test-mbt \ | |
| --all-features --codecov --output-path coverage-mbt.info | |
| - name: Generate text report | |
| run: cargo llvm-cov report | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mbt-coverage | |
| path: code/coverage-mbt.info | |
| retention-days: 1 | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: mbt | |
| fail_ci_if_error: false | |
| upload-coverage: | |
| name: Upload coverage to Codecov | |
| needs: [changes, integration, mbt] | |
| runs-on: ubuntu-latest | |
| if: ${{ !cancelled() && (needs.changes.outputs.code == 'true' || needs.changes.outputs.specs == 'true' || needs.changes.outputs.codecov == 'true' || github.ref == 'refs/heads/main') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create coverage directory | |
| run: mkdir -p code/coverage | |
| - name: Download integration coverage | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: integration-coverage | |
| path: code/coverage | |
| - name: Download MBT coverage | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: mbt-coverage | |
| path: code/coverage | |
| - name: List coverage files | |
| run: ls -la code/coverage | |
| - name: Upload integration coverage to Codecov | |
| working-directory: code | |
| run: | | |
| bash <(curl -s https://codecov.io/bash) -f coverage/coverage-integration.info -F integration | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload MBT coverage to Codecov | |
| working-directory: code | |
| run: | | |
| bash <(curl -s https://codecov.io/bash) -f coverage/coverage-mbt.info -F mbt | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |