From 90a90959142981cf93c603e9c16caee54de59d8f Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 17 Mar 2023 18:19:33 -0500 Subject: [PATCH 1/6] Migrate from actions-rs to dtolnay/rust-toolchain in GitHub actions Fixes #18 --- .github/workflows/ci.yaml | 21 ++++----------------- .github/workflows/release.yaml | 14 ++++---------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ef4de6f..4189a05 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,11 +28,7 @@ jobs: target/ key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }} - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: dtolnay/rust-toolchain@stable - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev - name: Run cargo test @@ -58,12 +54,9 @@ jobs: target/ key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }} - name: Install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - profile: minimal components: clippy - override: true - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Run clippy @@ -80,14 +73,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - profile: minimal components: rustfmt - override: true - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo run fmt diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5f15f01..93c4002 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,11 +22,9 @@ jobs: - uses: little-core-labs/get-git-tag@v3.0.1 id: get_version - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable target: wasm32-unknown-unknown - override: true - name: install wasm-bindgen-cli run: | cargo install wasm-bindgen-cli @@ -69,7 +67,7 @@ jobs: - uses: little-core-labs/get-git-tag@v3.0.1 id: get_version - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: toolchain: stable target: x86_64-unknown-linux-gnu @@ -117,11 +115,9 @@ jobs: - uses: little-core-labs/get-git-tag@v3.0.1 id: get_version - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable target: x86_64-pc-windows-msvc - override: true - name: Build run: | @@ -161,11 +157,9 @@ jobs: - uses: little-core-labs/get-git-tag@v3.0.1 id: get_version - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable target: x86_64-apple-darwin - override: true - name: Environment Setup run: | export CFLAGS="-fno-stack-check" From e03f3dde0dc4e211834b56d3609da47735ae0b55 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 17 Mar 2023 18:52:22 -0500 Subject: [PATCH 2/6] Fix typo in cargo fmt CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4189a05..d7f703f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,4 +77,4 @@ jobs: with: components: rustfmt - name: Run cargo fmt - run: cargo run fmt + run: cargo fmt From 675464d7b734a6d88cc44756585c5fff5bb5aeef Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 17 Mar 2023 18:54:59 -0500 Subject: [PATCH 3/6] Add back args for cargo fmt in CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d7f703f..67fcc28 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,4 +77,4 @@ jobs: with: components: rustfmt - name: Run cargo fmt - run: cargo fmt + run: cargo fmt --all -- --check From 73a3a200bdf9994ec19954d4c0d7f407ff8bdff1 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 17 Mar 2023 23:33:18 -0500 Subject: [PATCH 4/6] Remove remaining uses of action-rs GitHub actions --- .github/workflows/ci.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 67fcc28..8a25716 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,9 +32,7 @@ jobs: - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test # Run cargo clippy -- -D warnings clippy_check: @@ -60,10 +58,7 @@ jobs: - name: Install Dependencies run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - name: Run clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -- -D warnings + run: cargo clippy -- -D warnings # Run cargo fmt --all -- --check format: From 400d03a72019454978066157432c8cf95a6484d7 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 23 Mar 2023 19:45:46 -0500 Subject: [PATCH 5/6] Use targets instead of undocumented target variable --- .github/workflows/release.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 93c4002..76f05ba 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - target: wasm32-unknown-unknown + targets: wasm32-unknown-unknown - name: install wasm-bindgen-cli run: | cargo install wasm-bindgen-cli @@ -70,7 +70,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: stable - target: x86_64-unknown-linux-gnu + targets: x86_64-unknown-linux-gnu override: true - name: install dependencies run: | @@ -117,7 +117,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - target: x86_64-pc-windows-msvc + targets: x86_64-pc-windows-msvc - name: Build run: | @@ -159,7 +159,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - target: x86_64-apple-darwin + targets: x86_64-apple-darwin - name: Environment Setup run: | export CFLAGS="-fno-stack-check" From d2444ca039e8fe064a52eba7ac2f4ee5bfd01cd5 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 23 Mar 2023 19:47:36 -0500 Subject: [PATCH 6/6] Remove unused variables that were missed in migration to dtolnay actions --- .github/workflows/release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 76f05ba..4721e7a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -69,9 +69,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable targets: x86_64-unknown-linux-gnu - override: true - name: install dependencies run: | sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev