Merge branch 'main' into parse-dont-validate #202
This file contains 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
# SPDX-License-Identifier: Apache-2.0 | |
name: Test | |
on: | |
push: | |
pull_request: | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- stable | |
- 1.66.0 | |
feature: | |
- full | |
- serde | |
- protoc | |
exclude: | |
- rust: 1.66.0 | |
feature: protoc | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-check-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-check- | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}- | |
${{ runner.os }}-cargo-${{ matrix.rust }}- | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: arduino/setup-protoc@v3 | |
if: matrix.feature != 'protoc' | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: cargo check --features ${{ matrix.feature }} | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- stable | |
feature: | |
- full | |
- serde | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-test-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-test- | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}- | |
${{ runner.os }}-cargo-${{ matrix.rust }}- | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: cargo test --features ${{ matrix.feature }} | |
rustfmt: | |
name: Rustfmt | |
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 | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- stable | |
feature: | |
- full | |
- serde | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-clippy-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-clippy- | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}- | |
${{ runner.os }}-cargo-${{ matrix.rust }}- | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: clippy | |
- uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: cargo clippy --features ${{ matrix.feature }} -- -Dwarnings | |
package: | |
name: Package | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- stable | |
feature: | |
- full | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-package-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}-package- | |
${{ runner.os }}-cargo-${{ matrix.rust }}-${{ matrix.feature }}- | |
${{ runner.os }}-cargo-${{ matrix.rust }}- | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- run: cargo check --features ${{ matrix.feature }} | |
- run: cargo package --features ${{ matrix.feature }} --allow-dirty |