CI #267
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
# Run automatically every monday | |
schedule: | |
- cron: 1 12 * * 1 | |
name: CI | |
jobs: | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libgtk-4-dev build-essential | |
version: 2 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install stable components | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: clippy | |
- name: Run clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --verbose --release -- -D warnings | |
build_and_test: | |
name: Build and test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['macos-latest', 'ubuntu-22.04'] | |
rust: ['stable', '1.57'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libgtk-4-dev build-essential | |
version: 2 | |
if: startsWith(matrix.os, 'ubuntu-') | |
- name: Install dependencies (macOS) | |
run: brew install gtk4 pkg-config | |
if: matrix.os == 'macos-latest' | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Test | |
uses: GabrielBB/xvfb-action@v1 | |
with: | |
run: cargo test --features=test-ui-replay | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: Packetry ${{ matrix.os }} | |
path: | | |
target/release/packetry | |
target/release/packetry.exe | |