name: Build and Test
on: push
permissions:
actions: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
steps:
- name: Install missing linux libs
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update && \
sudo apt-get install libgtk-3-dev libxdo-dev libxkbcommon-x11-0 libappindicator3-dev
- name: Check out code
uses: actions/checkout@v5
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Build the library
run: cargo build --locked
- name: Build examples
run: cargo build --examples --locked
- name: Run headless test
uses: GabrielBB/xvfb-action@v1
with:
run: cargo test
trigger-publish:
needs: ["build"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-latest"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Trigger Release Work |
run: |
gh workflow run release_publish.yml