From 8eeed6ced01d1d45aceed1329331b825602205de Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Mon, 27 Jun 2022 01:09:43 +0200 Subject: [PATCH] refactor: minor ci dev/release pipeline updates --- .github/workflows/devel.yml | 29 +++++++++++++---------------- .github/workflows/release.docker.yml | 4 ++-- .github/workflows/release.yml | 16 +++++++--------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.github/workflows/devel.yml b/.github/workflows/devel.yml index f4af721..41238cd 100644 --- a/.github/workflows/devel.yml +++ b/.github/workflows/devel.yml @@ -14,10 +14,10 @@ jobs: name: test runs-on: ${{ matrix.os }} env: - CARGO: cargo - # When CARGO is set to CROSS, this is set to `--target matrix.target` + CARGO_BIN: cargo + # When CARGO_BIN is set to CROSS, this is set to `--target matrix.target` TARGET_FLAGS: "" - # When CARGO is set to CROSS, TARGET_DIR includes matrix.target + # When CARGO_BIN is set to CROSS, TARGET_DIR includes matrix.target TARGET_DIR: ./target # Emit backtraces on panics RUST_BACKTRACE: 1 @@ -48,7 +48,7 @@ jobs: # Specific Rust channels - build: pinned os: ubuntu-20.04 - rust: 1.60.0 + rust: 1.56.1 - build: stable os: ubuntu-20.04 rust: stable @@ -119,20 +119,19 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true + target: ${{ matrix.target }} - name: Use Cross if: matrix.target != '' run: | cargo install cross - echo "CARGO=cross" >> $GITHUB_ENV + echo "CARGO_BIN=cross" >> $GITHUB_ENV echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV @@ -141,7 +140,7 @@ jobs: - name: Show command used for Cargo run: | - echo "cargo command is: ${{ env.CARGO }}" + echo "cargo command is: ${{ env.CARGO_BIN }}" echo "target flag is: ${{ env.TARGET_FLAGS }}" echo "target dir is: ${{ env.TARGET_DIR }}" @@ -153,10 +152,10 @@ jobs: - name: Run tests if: env.SKIP_TESTS == '' - run: ${{ env.CARGO }} test --verbose ${{ env.TARGET_FLAGS }} + run: ${{ env.CARGO_BIN }} test --verbose ${{ env.TARGET_FLAGS }} - name: Run build - run: ${{ env.CARGO }} build --verbose ${{ env.TARGET_FLAGS }} + run: ${{ env.CARGO_BIN }} build --verbose ${{ env.TARGET_FLAGS }} checks: name: checks @@ -164,14 +163,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal toolchain: stable - override: true components: rustfmt, clippy - name: Check formatting diff --git a/.github/workflows/release.docker.yml b/.github/workflows/release.docker.yml index 1eee466..1504ab7 100644 --- a/.github/workflows/release.docker.yml +++ b/.github/workflows/release.docker.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -60,7 +60,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b47ec8..4711dc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,10 +39,10 @@ jobs: env: # For some builds, we use cross to test on 32-bit and big-endian # systems. - CARGO: cargo - # When CARGO is set to CROSS, this is set to `--target matrix.target`. + CARGO_BIN: cargo + # When CARGO_BIN is set to CROSS, this is set to `--target matrix.target`. TARGET_FLAGS: "" - # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. + # When CARGO_BIN is set to CROSS, TARGET_DIR includes matrix.target. TARGET_DIR: ./target # Emit backtraces on panics. RUST_BACKTRACE: 1 @@ -133,29 +133,27 @@ jobs: fetch-depth: 1 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true target: ${{ matrix.target }} - name: Use Cross shell: bash run: | cargo install cross - echo "CARGO=cross" >> $GITHUB_ENV + echo "CARGO_BIN=cross" >> $GITHUB_ENV echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV - name: Show command used for Cargo run: | - echo "cargo command is: ${{ env.CARGO }}" + echo "cargo command is: ${{ env.CARGO_BIN }}" echo "target flag is: ${{ env.TARGET_FLAGS }}" echo "target dir is: ${{ env.TARGET_DIR }}" - name: Build release binary - run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} + run: ${{ env.CARGO_BIN }} build --verbose --release ${{ env.TARGET_FLAGS }} - name: Strip release binary (linux and macos) if: matrix.os != 'windows-2019' && matrix.build != 'linux-arm-gnueabihf' && matrix.build != 'linux-musl-armv7' && matrix.build != 'linux-musl-armv6' && matrix.build != 'linux-gnu-arm64' && matrix.build != 'linux-musl-arm64' && matrix.build != 'linux-musl-i686' -- libgit2 1.7.2