Files
libnotify-rs/.github/workflows/tests.yml
2026-09-30 19:32:56 +02:00

66 lines
1.3 KiB
YAML

name: Unit and style tests
permissions:
actions: none
checks: read
contents: read
deployments: none
issues: none
discussions: none
packages: none
pages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: none
concurrency: # don't run the test when there's is a newer version
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ master ]
paths:
- "**.rs"
pull_request:
branches: [ master ]
paths:
- "**.rs"
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libnotify-dev clang pkg-config
- name: Test dev build
run: cargo test
- name: Test release build
run: cargo test --release
style-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: sudo apt install libnotify-dev clang pkg-config -y
- name: Clippy check
run: cargo clippy -- -D warnings
- name: Format check
run: cargo fmt -- --check