From 8a1f602a1d90c5b4a0d57dae74cd3c7541fb97ec Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 21 Apr 2023 00:05:49 +0200 Subject: Switch to dtolnay/rust-toolchain --- .github/workflows/build-release.yml | 17 +++++++---------- .github/workflows/ci.yml | 25 +++++-------------------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index ceb0aed..b1b7014 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -92,21 +92,18 @@ jobs: uses: actions/checkout@v2 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true + uses: dtolnay/rust-toolchain@stable - run: sudo apt install musl-tools if: startsWith(matrix.os, 'ubuntu') - name: cargo build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --locked --target=${{ matrix.target }} ${{ matrix.cargo_flags }} - use-cross: ${{ matrix.cross }} + run: cargo build --release --locked --target=${{ matrix.target }} ${{ matrix.cargo_flags }} + if: ${{ matrix.cross }} == false + + - name: cross build + run: cross build --release --locked --target=${{ matrix.target }} ${{ matrix.cargo_flags }} + if: ${{ matrix.cross }} == true - name: Set exe extension for Windows run: echo "EXE=.exe" >> $env:GITHUB_ENV diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 840f43a..f58b214 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,31 +15,16 @@ jobs: uses: actions/checkout@v2 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy + uses: dtolnay/rust-toolchain@stable - name: cargo build - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + run: cargo clippy -- -D warnings -- cgit v1.2.3 From 4256fb8e70397c632a8a6157dcb3a8c35cafde07 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 21 Apr 2023 00:18:41 +0200 Subject: Use houseabsolute/actions-rust-cross for cross support --- .github/workflows/build-release.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index b1b7014..885c9ff 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -13,77 +13,62 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-musl - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: x86_64-unknown-linux-gnu - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: aarch64-unknown-linux-musl - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: aarch64-unknown-linux-gnu - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: armv7-unknown-linux-musleabihf - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: armv7-unknown-linux-gnueabihf - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: arm-unknown-linux-musleabihf - cross: true compress: true cargo_flags: "" - os: ubuntu-latest target: mips-unknown-linux-musl - cross: true compress: false cargo_flags: "--no-default-features" - os: ubuntu-latest target: mipsel-unknown-linux-musl - cross: true compress: true cargo_flags: "--no-default-features" - os: ubuntu-latest target: mips64-unknown-linux-gnuabi64 - cross: true compress: false cargo_flags: "--no-default-features" - os: ubuntu-latest target: mips64el-unknown-linux-gnuabi64 - cross: true compress: false cargo_flags: "--no-default-features" - os: ubuntu-latest target: riscv64gc-unknown-linux-gnu - cross: true compress: false cargo_flags: "--no-default-features" - os: windows-latest target: x86_64-pc-windows-msvc - cross: false compress: true cargo_flags: "" - os: macos-latest target: x86_64-apple-darwin - cross: false compress: true cargo_flags: "" - os: ubuntu-latest target: x86_64-unknown-freebsd - cross: true compress: false cargo_flags: "" @@ -98,12 +83,11 @@ jobs: if: startsWith(matrix.os, 'ubuntu') - name: cargo build - run: cargo build --release --locked --target=${{ matrix.target }} ${{ matrix.cargo_flags }} - if: ${{ matrix.cross }} == false - - - name: cross build - run: cross build --release --locked --target=${{ matrix.target }} ${{ matrix.cargo_flags }} - if: ${{ matrix.cross }} == true + uses: houseabsolute/actions-rust-cross@v0 + with: + command: build + args: --release --locked ${{ matrix.cargo_flags }} + target: ${{ matrix.target }} - name: Set exe extension for Windows run: echo "EXE=.exe" >> $env:GITHUB_ENV -- cgit v1.2.3 From 779b44593f7093c96351ed7aa90439e72036ab2f Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Fri, 21 Apr 2023 07:58:14 +0200 Subject: Update checkout to v3 --- .github/workflows/build-release.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 885c9ff..7d59df5 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -147,7 +147,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download artifact aarch64-unknown-linux-gnu uses: actions/download-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f58b214..0519a2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable -- cgit v1.2.3