Skip to content

Commit

Permalink
Merge pull request #115 from martinling/update-actions
Browse files Browse the repository at this point in the history
Update github actions to latest versions
  • Loading branch information
miek authored Jul 13, 2024
2 parents ae82994 + 79d108b commit fc7d276
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ name: CI
jobs:
clippy:
name: Clippy
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -25,25 +25,20 @@ 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
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 }}
Expand All @@ -52,11 +47,12 @@ jobs:
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- uses: actions/checkout@v4

- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -65,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)
Expand Down Expand Up @@ -101,15 +97,15 @@ 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
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: |
Expand All @@ -135,19 +131,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'

0 comments on commit fc7d276

Please sign in to comment.