From 4fca0fedaa7b31430ff36d94dcd3c0120f75f45a Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 6 Jul 2024 20:02:44 +0100 Subject: [PATCH 1/5] Update github actions to latest versions. --- .github/workflows/rust.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1a4a5dd1..0d020f5a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -52,7 +52,7 @@ jobs: VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} @@ -135,19 +135,20 @@ jobs: if: matrix.os == 'windows-latest' - name: Upload binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Binary for ${{ matrix.os }} path: | target/release/packetry target/release/packetry.exe if-no-files-found: error + if: matrix.rust == 'stable' - name: Upload installer (Windows) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Windows installer path: | target/wix/*.msi if-no-files-found: error - if: runner.os == 'Windows' + if: runner.os == 'Windows' && matrix.rust == 'stable' From f627db9d029ae4f04bbf64d81fcc7ab40b519d0b Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 13 Jul 2024 14:22:37 +0100 Subject: [PATCH 2/5] Replace Rust actions with direct use of rustup and cargo. --- .github/workflows/rust.yml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0d020f5a..7423d7e5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,18 +25,13 @@ jobs: - uses: Swatinem/rust-cache@v2 - - name: Install stable components - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: clippy + - name: Install toolchain + run: | + rustup toolchain install stable + rustup default stable - name: Run clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --verbose --release -- -D warnings + run: cargo clippy -- --deny warnings build_and_test: name: Build and test @@ -53,10 +48,11 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - override: true + + - name: Install toolchain + run: | + rustup toolchain install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -101,10 +97,7 @@ jobs: if: matrix.os == 'windows-latest' - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + run: cargo build --release - name: Test uses: GabrielBB/xvfb-action@v1 From 0bde2fb3475c51c4f9a80d29ade686e92f9f6c48 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 13 Jul 2024 14:23:19 +0100 Subject: [PATCH 3/5] Use latest version of Ubuntu runner. --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7423d7e5..0e89e1e9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,7 +12,7 @@ name: CI jobs: clippy: name: Clippy - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout repository @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['macos-latest', 'ubuntu-22.04', 'windows-latest'] + os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] rust: ['stable', '1.74'] runs-on: ${{ matrix.os }} From 050dbc3b5a16fe93c06ae2877911e4116235d280 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 13 Jul 2024 14:57:29 +0100 Subject: [PATCH 4/5] Replace XVFB action with direct use of xvfb-run. --- .github/workflows/rust.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0e89e1e9..b1773c08 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,9 +100,12 @@ jobs: run: cargo build --release - name: Test - uses: GabrielBB/xvfb-action@v1 - with: - run: cargo test + run: cargo test + if: runner.os != 'Linux' + + - name: Test under XVFB (Linux) + run: xvfb-run cargo test + if: runner.os == 'Linux' - name: Compile glib schemas (Windows) run: | From 79d108bc2a63913e7a756aa65a3608cbe047c88a Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 13 Jul 2024 14:58:25 +0100 Subject: [PATCH 5/5] Don't try to install pkg-config on macOS; the runner has it already. --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b1773c08..4f84e0ba 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -61,7 +61,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu-') - name: Install dependencies (macOS) - run: brew install gtk4 pkg-config + run: brew install gtk4 if: matrix.os == 'macos-latest' - name: Install cargo-wix (Windows)