hwt/.github/workflows/ci.yml

75 lines
1.6 KiB
YAML

name: CI
on:
push:
branches: ["*"]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest
rust:
- stable
- nightly
steps:
- uses: actions/checkout@v2
- name: Restore cargo cache
uses: actions/cache@v2.1.7
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true
profile: minimal
components: clippy
- name: Install deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y \
build-essential \
pkg-config \
libasound2-dev \
libglib2.0-dev \
libcairo2-dev \
libatk1.0-dev \
libsdl-pango-dev \
libgdk-pixbuf2.0-dev \
libgtk-3-dev
- name: Build Debug
run: |
rustc --version
cargo build
- name: Run clippy
run: cargo clippy -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- run: cargo fmt -- --check