Tweak default CI #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "archived/**" | |
- "**/README.md" | |
- ".gitignore" | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
# Sourced from https://vulkan.lunarg.com/sdk/home#linux | |
VULKAN_SDK_VERSION: "1.3.268" | |
# Sourced from https://archive.mesa3d.org/. Bumping this requires | |
# updating the mesa build in https://github.com/gfx-rs/ci-build and creating a new release. | |
MESA_VERSION: "23.3.1" | |
# Corresponds to https://github.com/gfx-rs/ci-build/releases | |
MESA_CI_BINARY_BUILD: "build18" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
python-version: ["3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 2 | |
- uses: extractions/setup-just@v1 | |
with: | |
just-version: 1.35.0 | |
# - name: Install the stable toolchain | |
# uses: dtolnay/rust-toolchain@stable | |
# with: | |
# components: rustfmt | |
- name: Install the nightly toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
# - name: Install latest nextest release | |
# uses: taiki-e/install-action@nextest | |
- name: Set up cargo cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "8" | |
- name: Setup Linux for GPU | |
if: runner.os == 'Linux' | |
uses: tracel-ai/github-actions/setup-linux@v1 | |
with: | |
vulkan-sdk-version: ${{ env.VULKAN_SDK_VERSION }} | |
mesa-version: ${{ env.MESA_VERSION }} | |
mesa-ci-build-version: ${{ env.MESA_CI_BINARY_BUILD }} | |
- name: Install linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install libwebkit2gtk-4.1-dev \ | |
build-essential \ | |
pkg-config \ | |
curl \ | |
wget \ | |
file \ | |
libxdo-dev \ | |
libssl-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev \ | |
libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 | |
# - name: Check examples | |
# run: cargo check --examples | |
# - name: Lint | |
# run: cargo clippy --workspace -- -D warnings | |
# - name: Format | |
# run: cargo +nightly fmt --all --check -- --error-on-unformatted --unstable-features | |
# - name: Run tests | |
# run: just test | |
- name: Run tests (nightly) | |
run: just test-nightly | |
- name: Setup xmake | |
if: runner.os == 'macOS' | |
uses: xmake-io/github-action-setup-xmake@v1 | |
with: | |
xmake-version: '2.9.5' | |
# - if: runner.os == 'macOS' | |
# run: | | |
# mkdir -p yard-cpp/xmake-xp/build/.build_cache | |
# - name: xmake cache | |
# if: runner.os == 'macOS' | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# yard-cpp/xmake-xp/build/ | |
# yard-cpp/xmake-xp/.xmake/ | |
# key: ${{ runner.os }}-xmake-${{ github.run_id }} | |
# restore-keys: | | |
# ${{ runner.os }}-xmake- | |
- name: Run xmake project | |
if: runner.os == 'macOS' | |
run: | | |
cd yard-cpp/xmake-xp | |
just | |
# - name: Run coverage | |
# if: runner.os == 'Linux' | |
# run: | | |
# rustup component add llvm-tools-preview | |
# curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - | |
# ./grcov . --binary-path ./target/debug/deps -s . -t lcov --branch --ignore-not-existing --ignore "../*" --ignore "/*" -o cov.lcov | |
# - uses: codecov/codecov-action@v4 | |
# if: runner.os == 'Linux' | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# - name: Install Python ${{ matrix.python-version }} | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: Test evcxr notebooks | |
# run: | | |
# cd notebooks | |
# just prep | |
# just test |