Continuous Integration #379
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
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * 0" | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { os: ubuntu-latest, target: "x86_64-unknown-linux-gnu" } | |
- { os: macos-latest, target: "x86_64-apple-darwin" } | |
- { os: windows-latest, target: "x86_64-pc-windows-msvc" } | |
profile: ["", "--release"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
if: matrix.config.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install --allow-unauthenticated -y -qq \ | |
libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | |
- name: Cache Cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.config.target }} | |
override: true | |
profile: minimal | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --locked --target ${{ matrix.config.target }} ${{ matrix.profile }} | |
fmt: | |
runs-on: ubuntu-latest | |
name: Formatting | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
name: Linting | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --allow-unauthenticated -y -qq \ | |
libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Run Clippy | |
run: cargo clippy -- -D warnings |