Skip to content

Commit

Permalink
AVRO-3828: [Rust] Fix CI build warnings (#2434)
Browse files Browse the repository at this point in the history
* AVRO-3828: [Rust] Enable "RUSTFLAGS=-Dwarnings" for all Rust CI workflows

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3828: [Rust] Replace Github Action actions-rs with dtolnay/toolchain

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3828: [PHP] Replace usage of ::set-output with $GITHUB_OUTPUT

See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3828: [Rust] Quote the versions of Rust in the CI matrix

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3828: [Rust] Use dtolnay/toolchain@nightly only

Only '@nightly' is whitelisted by ASF Infra

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* AVRO-3828: Remove '--manifest-path ...'.

defaults:
  run:
    working-directory: lang/rust

now is taken into account!

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

---------

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g authored Aug 11, 2023
1 parent 3deb73c commit e6d1804
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-lang-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-lang-rust-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ on:
- lang/rust/Cargo.toml
- lang/rust/Cargo.lock

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

defaults:
run:
working-directory: lang/rust
Expand All @@ -41,12 +47,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
# Currently does not work. See https://github.com/actions-rs/audit-check/issues/194
#- name: Rust Audit
# uses: actions-rs/audit-check@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# Install it manually
- name: Dependency Review
if: github.event_name == 'pull_request'
uses: actions/dependency-review-action@v3
Expand Down
55 changes: 20 additions & 35 deletions .github/workflows/test-lang-rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ on:
- .github/workflows/test-lang-rust-ci.yml
- lang/rust/**

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

defaults:
run:
working-directory: lang/rust
Expand All @@ -40,10 +46,10 @@ jobs:
strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.65.0 # MSRV
- 'stable'
- 'beta'
- 'nightly'
- '1.65.0' # MSRV
target:
- x86_64-unknown-linux-gnu
- wasm32-unknown-unknown
Expand All @@ -68,48 +74,31 @@ jobs:
key: ${{ runner.os }}-target-cache1-${{ matrix.rust }}-

- name: Rust Toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Rust Format
if: matrix.target != 'wasm32-unknown-unknown'
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path lang/rust/Cargo.toml --all -- --check
run: cargo fmt --all -- --check

- name: Rust Build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path lang/rust/Cargo.toml --all-features --all-targets
run: cargo build --all-features --all-targets

- name: Rust Test
if: matrix.target != 'wasm32-unknown-unknown'
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path lang/rust/Cargo.toml --all-features --target ${{ matrix.target }}
run: cargo test --all-features --target ${{ matrix.target }}

- name: Rust Test AVRO-3549
if: matrix.target != 'wasm32-unknown-unknown'
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path lang/rust/Cargo.toml --target ${{ matrix.target }} test_avro_3549_read_not_enabled_codec
run: cargo test --target ${{ matrix.target }} test_avro_3549_read_not_enabled_codec

# because of https://github.com/rust-lang/cargo/issues/6669
- name: Rust Test docs
if: matrix.target != 'wasm32-unknown-unknown'
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path lang/rust/Cargo.toml --doc
run: cargo test --doc

interop:
runs-on: ubuntu-latest
Expand All @@ -119,11 +108,9 @@ jobs:
uses: actions/checkout@v3

- name: Rust Toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Cargo
uses: actions/cache@v3
Expand Down Expand Up @@ -205,12 +192,10 @@ jobs:
uses: actions/checkout@v3

- name: Rust Toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
targets: wasm32-unknown-unknown

- name: Cache Cargo
uses: actions/cache@v3
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test-lang-rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ on:
- .github/workflows/test-lang-rust-clippy.yml
- lang/rust/**

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

defaults:
run:
working-directory: lang/rust
Expand All @@ -39,12 +45,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path lang/rust/Cargo.toml --all-features --all-targets -- -Dclippy::all -Dunused_imports
- run: cargo clippy --all-features --all-targets -- -Dclippy::all -Dunused_imports

0 comments on commit e6d1804

Please sign in to comment.