Skip to content

ci: create github workflow to test on Ubuntu, Windows, Mac OS #7

ci: create github workflow to test on Ubuntu, Windows, Mac OS

ci: create github workflow to test on Ubuntu, Windows, Mac OS #7

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
default-build:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v5
with:
lfs: true
- run: rustup component add rustfmt clippy
# dependencies for wxWidgets (see installation instructions and github
# workflow of https://github.com/allendang/wxdragon)
- name: Install deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libpng-dev libjpeg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libexpat1-dev libtiff-dev libwebkit2gtk-4.1-dev libxtst-dev
- name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: build
run: cargo build
- name: clippy
run: cargo clippy --all-features -- -D warnings
- name: check formatting
run: cargo fmt --all -- --check
# - name: headless tests
# uses: coactions/setup-xvfb@v1
# with:
# # skip main doc test because it opens a window
# # run: cargo test --all-features --verbose
# run: cargo test --all-features --verbose --lib --tests
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# dependencies for wxWidgets (see installation instructions and github
# workflow of https://github.com/allendang/wxdragon)
- name: Install deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libpng-dev libjpeg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libexpat1-dev libtiff-dev libwebkit2gtk-4.1-dev libxtst-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build documentation
run: cargo doc --all-features --no-deps