aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-06 17:11:25 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-06 17:11:25 +0400
commit75c75c93e1d574a33f0367ca2074441fab634296 (patch)
treec92c39370d89063b6541b83d3ac7d63616ed3bde /.github/workflows/ci.yml
parent74607374819e000fb4d43a923176be17b838ff29 (diff)
downloadniri-75c75c93e1d574a33f0367ca2074441fab634296.tar.gz
niri-75c75c93e1d574a33f0367ca2074441fab634296.tar.bz2
niri-75c75c93e1d574a33f0367ca2074441fab634296.zip
Add CI
Surely this will work first try
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml94
1 files changed, 94 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..65612e05
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,94 @@
+name: CI
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+ schedule:
+ - cron: '0 0 1 * *' # Monthly
+
+jobs:
+ build:
+ strategy:
+ fail-fast: false
+
+ matrix:
+ configuration: [debug, release]
+
+ include:
+ - configuration: release
+ release-flag: '--release'
+
+ name: test - ${{ matrix.configuration }}
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ show-progress: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev
+
+ - name: Install Rust
+ run: |
+ rustup set auto-self-update check-only
+ rustup toolchain install stable --profile minimal
+
+ - uses: Swatinem/rust-cache@v2
+ with:
+ key: ${{ matrix.configuration }}
+
+ - name: Build
+ run: cargo build ${{ matrix.release-flag }}
+
+ - name: Build Tests
+ run: cargo test --no-run --all ${{ matrix.release-flag }}
+
+ - name: Test
+ run: cargo test --all ${{ matrix.release-flag }} -- --nocapture
+
+ clippy:
+ strategy:
+ fail-fast: false
+
+ name: clippy
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ show-progress: false
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev
+
+ - name: Install Rust
+ run: |
+ rustup set auto-self-update check-only
+ rustup toolchain install stable --profile minimal --component clippy
+
+ - uses: Swatinem/rust-cache@v2
+
+ - name: Run clippy
+ run: cargo clippy --all --all-targets
+
+ rustfmt:
+ runs-on: ubuntu-22.04
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Rust
+ run: |
+ rustup set auto-self-update check-only
+ rustup toolchain install nightly --profile minimal --component rustfmt
+ rustup override set nightly
+
+ - name: Run rustfmt
+ run: cargo fmt --all -- --check
+