Skip to content

fix(deps): update rust crate thiserror to v2.0.8 (#143) #507

fix(deps): update rust crate thiserror to v2.0.8 (#143)

fix(deps): update rust crate thiserror to v2.0.8 (#143) #507

Workflow file for this run

name: CI
on:
push:
branches:
- main
workflow_call:
# This is required to run checks on the translations PR.
# This is because actions are not triggered on PRs from an action.
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
checks: write
env:
CARGO_TERM_COLOR: always
FROM_REF: ${{ github.event.pull_request.base.sha || (!github.event.forced && ( github.event.before != '0000000000000000000000000000000000000000' && github.event.before || github.sha )) || format('{0}~', github.sha) }}
TO_REF: ${{ github.sha }}
jobs:
test:
name: Test for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: llvm-tools-preview
cache: false
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-deny,nextest,cargo-llvm-cov
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install pre-commit & gitlint
run: python -m pip install pre-commit gitlint
- run: python -m pip freeze --local
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: pre-commit validation
run: pre-commit run --show-diff-on-failure --color=always --from-ref ${{ env.FROM_REF }} --to-ref ${{ env.TO_REF }} --hook-stage manual
- name: gitlint validation
run: gitlint --commits ${{ env.FROM_REF }}..${{ env.TO_REF }}
if: always()
- name: Formatting
uses: clechasseur/rs-cargo@v2
with:
command: fmt
args: --check
- name: Check
uses: clechasseur/rs-cargo@v2
with:
command: check
args: --all-targets --all-features --locked
- name: Linting
uses: clechasseur/rs-cargo@v2
with:
command: clippy
args: --all-targets --all-features --locked -- -D warnings
- name: Tests
run: |
cargo llvm-cov --no-report nextest --profile ci --locked
# cargo llvm-cov --no-report --doc
# cargo llvm-cov report --doctests --lcov --output-path lcov-${{ matrix.os }}.info
cargo llvm-cov report --lcov --output-path lcov-${{ matrix.os }}.info
- name: Replace workspace in lcov
run: perl -i -pe's%\Q${{ github.workspace }}\E%WORKSPACE%g' lcov-${{ matrix.os }}.info
- name: Upload code coverage to GitHub
uses: actions/upload-artifact@v4
with:
name: code-coverage-${{ matrix.os }}
path: lcov-${{ matrix.os }}.info
continue-on-error: true
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
report_paths: 'target/nextest/ci/junit.xml'
check_name: JUnit Test Report for ${{ matrix.os }}
detailed_summary: true
continue-on-error: true
coverage_report:
name: Generate coverage report
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
issues: write
steps:
- name: Install LCOV
if: success() || failure()
uses: hrishikesh-kadam/setup-lcov@v1
- uses: actions/checkout@v4
- name: Download code coverage from GitHub
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: code-coverage-*
- uses: taiki-e/install-action@v2
with:
tool: grcov
- name: Replace placeholder in lcov
run: find lcov-*.info -type f -print0 | xargs -0 -I {} sh -c 'sed "s%WORKSPACE%${{ github.workspace }}%g" {} > ${{ runner.temp }}/{}; grcov ${{ runner.temp }}/{} -s . --guess-directory-when-missing > {}'
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v4
if: success() || failure()
with:
coverage-files: lcov-*.info
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true