105 lines
3.2 KiB
YAML
105 lines
3.2 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
format_and_clippy_nightly_toolchain:
|
|
runs-on : ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: false
|
|
|
|
- name: Install ubuntu dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y librust-gdk4-sys-dev \
|
|
libglib2.0-dev libgtk-layer-shell-dev libgtk-layer-shell0 gir1.2-gtklayershell-0.1 \
|
|
libgtk-4-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools python3 valac \
|
|
git cmake gcc meson ninja-build
|
|
|
|
- name: Install gt4k layer shell
|
|
run: |
|
|
git clone https://github.com/wmww/gtk4-layer-shell
|
|
cd gtk4-layer-shell
|
|
meson setup -Dexamples=true -Ddocs=true -Dtests=true build
|
|
ninja -C build
|
|
sudo ninja -C build install
|
|
sudo ldconfig
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
toolchain: nightly-2025-07-14
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Formating - check for long lines
|
|
run: cargo fmt -- --check --config error_on_unformatted=true,error_on_line_overflow=true,format_strings=true
|
|
|
|
- name: Formatting - check import order
|
|
run: cargo fmt -- --check --config group_imports=StdExternalCrate
|
|
|
|
- name: Formatting - check imports granularity
|
|
run: cargo fmt -- --check --config imports_granularity=Crate
|
|
|
|
- name: run clippy nightly
|
|
run: cargo clippy --all-targets -- -D warnings
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Install ubuntu dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y librust-gdk4-sys-dev \
|
|
libglib2.0-dev libgtk-layer-shell-dev libgtk-layer-shell0 gir1.2-gtklayershell-0.1 \
|
|
libgtk-4-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools python3 valac \
|
|
git cmake gcc meson ninja-build
|
|
|
|
- name: Install gt4k layer shell
|
|
run: |
|
|
git clone https://github.com/wmww/gtk4-layer-shell
|
|
cd gtk4-layer-shell
|
|
meson setup -Dexamples=true -Ddocs=true -Dtests=true build
|
|
ninja -C build
|
|
sudo ninja -C build install
|
|
sudo ldconfig
|
|
|
|
- name: Install taplo toml toolkit
|
|
run: cargo install --locked taplo-cli
|
|
- name: Toml Formatting
|
|
run: taplo fmt --check --diff
|
|
|
|
- name: Rust Formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Clippy warnings
|
|
run: cargo clippy -- -D warnings
|
|
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
|
|
- name: Run tests
|
|
run: cargo test -- --show-output
|