Skip to content

Commit

Permalink
Ubify CI with RustCycles somewhat
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-t committed Oct 10, 2023
1 parent 0087fed commit 123b383
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ on:
pull_request:
branches: [ master ]
schedule:
# Runs at 15:00 UTC on Fri
# Runs at 15:00 UTC on Fri
- cron: "0 15 * * 5"
workflow_dispatch:
# This allows running it on any branch manually:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow

env:
CARGO_TERM_COLOR: always
Expand All @@ -22,25 +25,44 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, nightly]
# For reference: https://github.com/actions/virtual-environments#available-environments
os: [ubuntu-latest, windows-latest, macos-latest]
exclude:
# Each minute of MacOS CI counts as 10 minutes towards the limit
# (https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers)
# and nightly doesn't benefit from caching much
# so this combination would take up the vast majority of the free CI limit.
- os: macos-latest
rust: nightly

steps:
- name: Install linux deps
if: ${{ matrix.os == 'ubuntu-latest' }}
# Run update first or install might start failing eventually
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev
- run: rustup target add wasm32-unknown-unknown

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191

- name: Print versions
run: rustc --version && cargo --version

- name: Build native
run: cargo build --verbose
# Use build instead of check since it needs to be built for tests anyway
run: cargo build --verbose --all-features

- name: Run tests
run: cargo test --verbose --all-features
# Test WASM only on ubuntu - the result should be the same on any OS and ubuntu is the fastest.

- name: Build web
# Test WASM only on ubuntu - the result should be the same on any OS and ubuntu is the fastest.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo build --verbose --target wasm32-unknown-unknown

Expand All @@ -51,13 +73,18 @@ jobs:
- run: cargo fmt --version
- run: cargo fmt -- --check

clippy:
lint:
runs-on: ubuntu-latest
steps:
- run: |
- name: Install linux deps
# Run update first or install might start failing eventually
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev
- uses: actions/checkout@v3
# Use rust-toolchain because GHA tends to still have an old version for a few days after a new Rust release.
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191
- run: cargo clippy --version

Expand Down

0 comments on commit 123b383

Please sign in to comment.