feat: Enhance tempoch FFI with GNSS week-number support and time data… #60
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: tempoch CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| COVERAGE_IGNORE_REGEX: "tempoch-time-data(-updater)?/" | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo check --all-targets --all-features | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: cargo clippy --all-targets --all-features -- -D warnings | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo test --all-targets --all-features | |
| - run: cargo test --doc --all-features | |
| coverage: | |
| name: Test & Coverage | |
| if: ${{ github.event_name == 'push' || github.event.pull_request.draft == false }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust (nightly + llvm-tools) | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: llvm-tools-preview | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: Coverage (run, no report) | |
| run: cargo +nightly llvm-cov --workspace --all-features --doctests --no-report | |
| - name: Coverage (Cobertura XML) | |
| run: cargo +nightly llvm-cov report --ignore-filename-regex "$COVERAGE_IGNORE_REGEX" --cobertura --output-path coverage.xml | |
| - name: Coverage (HTML) | |
| run: cargo +nightly llvm-cov report --ignore-filename-regex "$COVERAGE_IGNORE_REGEX" --html --output-dir coverage_html | |
| - name: Build coverage summary (Markdown) | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: coverage.xml | |
| badge: true | |
| format: markdown | |
| output: file | |
| - name: Publish to Job Summary | |
| run: cat code-coverage-results.md >> "$GITHUB_STEP_SUMMARY" | |
| - name: Post coverage as PR comment | |
| if: github.event_name == 'pull_request' | |
| uses: mshick/add-pr-comment@v2 | |
| with: | |
| message-path: code-coverage-results.md | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Coverage gate (>=90% lines) | |
| run: cargo +nightly llvm-cov report --ignore-filename-regex "$COVERAGE_IGNORE_REGEX" --fail-under-lines 90 | |
| - name: Upload coverage HTML | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-html | |
| path: coverage_html | |
| retention-days: 7 |