chore(rust): switch to validating mlt-nom variant #826
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: Rust CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
defaults: | |
run: { working-directory: ./rust/mlt-nom } | |
steps: | |
- uses: actions/checkout@v5 | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@v2 | |
with: { tool: 'just,cargo-binstall' } | |
- uses: ./.github/actions/mlt-setup-java | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- run: just -v ci-test | |
test-msrv: | |
name: Test MSRV | |
runs-on: ubuntu-latest | |
defaults: | |
run: { working-directory: ./rust/mlt-nom } | |
steps: | |
- uses: actions/checkout@v5 | |
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' | |
uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@v2 | |
with: { tool: 'just' } | |
- uses: ./.github/actions/mlt-setup-java | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- name: Read MSRV | |
id: msrv | |
run: echo "value=$(just get-msrv)" >> $GITHUB_OUTPUT | |
- name: Install MSRV Rust ${{ steps.msrv.outputs.value }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ steps.msrv.outputs.value }} | |
- run: just -v ci_mode=0 ci-test-msrv # Ignore warnings in MSRV | |
coverage: | |
name: Code Coverage | |
if: github.event_name != 'release' && github.repository_owner == 'maplibre' | |
runs-on: ubuntu-latest | |
defaults: | |
run: { working-directory: ./rust/mlt-nom } | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: taiki-e/install-action@v2 | |
with: { tool: 'just,cargo-llvm-cov' } | |
- uses: ./.github/actions/mlt-setup-java | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- name: Generate code coverage | |
run: just -v ci-coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: target/llvm-cov/codecov.info | |
# This job checks if any of the previous jobs failed or were canceled. | |
# This approach also allows some jobs to be skipped if they are not needed. | |
ci-passed: | |
needs: [ test, test-msrv ] | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Result of the needed steps | |
run: echo "${{ toJSON(needs) }}" | |
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: exit 1 |