pinnacle/.github/workflows/ci.pinnacle.yml
2024-04-20 19:36:25 -05:00

81 lines
2.6 KiB
YAML

name: CI (Pinnacle)
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache stuff
uses: Swatinem/rust-cache@v2
- name: Get dependencies
run: sudo apt update && sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgbm-dev libseat-dev libsystemd-dev protobuf-compiler xwayland libegl-dev lua5.4
- name: Setup LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: Build
run: cargo build --verbose
- name: Celebratory yahoo
run: echo yahoo
test:
runs-on: ubuntu-latest
name: Run tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache stuff
uses: Swatinem/rust-cache@v2
- name: Get dependencies
run: sudo apt update && sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgbm-dev libseat-dev libsystemd-dev protobuf-compiler xwayland libegl-dev foot lua5.4
- name: Setup LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: Build
if: ${{ runner.debug != '1' }}
run: cargo test -- --test-threads=1
- name: Build (debug)
if: ${{ runner.debug == '1' }}
run: RUST_LOG=debug cargo test -- --nocapture --test-threads=1
check-format:
runs-on: ubuntu-latest
name: Check formatting
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt -- --check
clippy-check:
runs-on: ubuntu-latest
name: Clippy check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache stuff
uses: Swatinem/rust-cache@v2
- name: Get dependencies
run: sudo apt update && sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgbm-dev libseat-dev libsystemd-dev protobuf-compiler xwayland libegl-dev lua5.4
- name: Setup LuaRocks
uses: leafo/gh-actions-luarocks@v4
- name: Clippy check
run: cargo clippy -- -D warnings