Skip to content

Removed crash-prone unwraps. Fixes #202 #47

Removed crash-prone unwraps. Fixes #202

Removed crash-prone unwraps. Fixes #202 #47

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Rust Checks
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
jobs:
cargo_format:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Ensure rustfmt is installed and setup problem matcher
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
clippy_check:
name: cargo clippy
container: fedora:latest
runs-on: ubuntu-latest
steps:
- name: Install system packages
run: |
microdnf -y install --nodocs --setopt=install_weak_deps=0 \
@development-tools @rpm-development-tools rpkg git nodejs rustup \
'dnf5-command(builddep)' 'dnf5-command(copr)'
# It is necessary to checkout into sub-directory, because of some weird ownership problems cause by using containers
- name: Check out sources
uses: actions/checkout@v5
with:
fetch-depth: 0
path: swayosd
- name: Copy spec into root dir
run: |
cd swayosd
cp ./build-scripts/swayosd-git.rpkg.spec ./
- name: Generate spec
run: |
cd swayosd
mkdir specs -p
rpkg spec --source --outdir specs
- name: Install build dependencies
run: |
cd swayosd
microdnf -y builddep ./specs/swayosd-git.rpkg.spec
rustup-init -y --default-toolchain nightly
- name: Run Clippy
run: |
cd swayosd
cargo clippy --all-targets --all-features