Skip to content

Commit ee74170

Browse files
committed
chore(rust): switch to validating mlt-nom variant
The `rust/mlt` branch is no longer capable of parsing current data format, and should be migrated to the newer `rust/mlt-nom` implementation. For now, I renamed `rust.yml` into `rust-legacy.yml`, which at some point will be deleted.
1 parent b8e0f4a commit ee74170

File tree

3 files changed

+86
-4
lines changed

3 files changed

+86
-4
lines changed

.github/workflows/rust-legacy.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run: { working-directory: ./rust/mlt }
16+
steps:
17+
- uses: actions/checkout@v5
18+
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
19+
uses: Swatinem/rust-cache@v2
20+
- uses: taiki-e/install-action@v2
21+
with: { tool: 'just,cargo-binstall' }
22+
- uses: ./.github/actions/mlt-setup-java
23+
- name: Install protoc
24+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
25+
- run: just -v ci-test
26+
27+
test-msrv:
28+
name: Test MSRV
29+
runs-on: ubuntu-latest
30+
defaults:
31+
run: { working-directory: ./rust/mlt }
32+
steps:
33+
- uses: actions/checkout@v5
34+
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
35+
uses: Swatinem/rust-cache@v2
36+
- uses: taiki-e/install-action@v2
37+
with: { tool: 'just' }
38+
- uses: ./.github/actions/mlt-setup-java
39+
- name: Install protoc
40+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
41+
- name: Read MSRV
42+
id: msrv
43+
run: echo "value=$(just get-msrv)" >> $GITHUB_OUTPUT
44+
- name: Install MSRV Rust ${{ steps.msrv.outputs.value }}
45+
uses: dtolnay/rust-toolchain@stable
46+
with:
47+
toolchain: ${{ steps.msrv.outputs.value }}
48+
- run: just -v ci_mode=0 ci-test-msrv # Ignore warnings in MSRV
49+
50+
coverage:
51+
name: Code Coverage
52+
if: github.event_name != 'release' && github.repository_owner == 'maplibre'
53+
runs-on: ubuntu-latest
54+
defaults:
55+
run: { working-directory: ./rust/mlt }
56+
steps:
57+
- uses: actions/checkout@v5
58+
- uses: Swatinem/rust-cache@v2
59+
- uses: taiki-e/install-action@v2
60+
with: { tool: 'just,cargo-llvm-cov' }
61+
- uses: ./.github/actions/mlt-setup-java
62+
- name: Install protoc
63+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
64+
- name: Generate code coverage
65+
run: just -v ci-coverage
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@v5
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
files: target/llvm-cov/codecov.info
71+
72+
# This job checks if any of the previous jobs failed or were canceled.
73+
# This approach also allows some jobs to be skipped if they are not needed.
74+
ci-passed:
75+
needs: [ test, test-msrv ]
76+
if: always()
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Result of the needed steps
80+
run: echo "${{ toJSON(needs) }}"
81+
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
82+
run: exit 1

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Test
1313
runs-on: ubuntu-latest
1414
defaults:
15-
run: { working-directory: ./rust/mlt }
15+
run: { working-directory: ./rust/mlt-nom }
1616
steps:
1717
- uses: actions/checkout@v5
1818
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
@@ -28,7 +28,7 @@ jobs:
2828
name: Test MSRV
2929
runs-on: ubuntu-latest
3030
defaults:
31-
run: { working-directory: ./rust/mlt }
31+
run: { working-directory: ./rust/mlt-nom }
3232
steps:
3333
- uses: actions/checkout@v5
3434
- if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
@@ -52,7 +52,7 @@ jobs:
5252
if: github.event_name != 'release' && github.repository_owner == 'maplibre'
5353
runs-on: ubuntu-latest
5454
defaults:
55-
run: { working-directory: ./rust/mlt }
55+
run: { working-directory: ./rust/mlt-nom }
5656
steps:
5757
- uses: actions/checkout@v5
5858
- uses: Swatinem/rust-cache@v2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repos:
4646
hooks:
4747
- id: actionlint
4848
additional_dependencies: [ shellcheck-py ]
49-
exclude: '.github/workflows/rust.yml'
49+
exclude: '\.github/workflows/rust(-legacy)?\.yml'
5050

5151
- repo: local
5252
hooks:

0 commit comments

Comments
 (0)