Skip to content

fix: codecov and release sha256 #13

fix: codecov and release sha256

fix: codecov and release sha256 #13

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 57, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CODECOV_TOKEN != '', (Line: 66, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CODECOV_TOKEN == ''
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Tests
run: cargo test --all-features
coverage:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install stable toolchain with coverage tools
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt,llvm-tools-preview
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Generate coverage report
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: ${{ secrets.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
flags: rust
fail_ci_if_error: true
- name: Warn when Codecov token is missing
if: ${{ secrets.CODECOV_TOKEN == '' }}
run: |
echo "::warning title=Codecov upload skipped::Set the CODECOV_TOKEN repository secret to enable coverage uploads."