Don't log panic info twice #403
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: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
# Runs at 15:00 UTC on Fri | |
- cron: "0 15 * * 5" | |
env: | |
CARGO_TERM_COLOR: always | |
# Deny warns here as a catch-all and because some commands (e.g. cargo build) don't accept `--deny warnings` | |
# but also deny them on all individual cargo invocations where applicable because: | |
# 1) Some commands might not support rustflags (e.g. clippy didn't at first, cargo doc uses a different var, ...) | |
# 2) People (or me) might copy paste the commands into CI where this flag is missing without noticing. | |
RUSTFLAGS: --deny warnings | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Install linux deps | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
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: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 | |
- name: Print versions | |
run: rustc --version && cargo --version | |
- name: Build native | |
run: cargo build --verbose | |
- 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 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: cargo build --verbose --target wasm32-unknown-unknown | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: cargo fmt --version | |
- run: cargo fmt -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- 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 | |
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 | |
- run: cargo clippy --version | |
# Use --all-targets to also check tests. | |
# Note that --all-features doesn't check all code when something is *disabled* by a feature. | |
- run: cargo clippy --all-targets --all-features -- --deny warnings | |
# No fixmes allowed - they're to be fixed before committing | |
# or at least before merging to master so they can be used | |
# during development for things that must not be forgotten | |
# and grep's output is not littered with other people's fixmes. | |
# | |
# Grep returns success when found and failure when not found, `!` inverts success/failure. | |
# The `[F]` is the usual trick to avoid matching this line itself | |
# without excluding this whole file so it's still checked. | |
- run: '! ( grep --recursive --exclude-dir=target [F]IXME . && echo "The lines above this message must be fixed (or marked as todo/later in uppercase, not fixme)" )' | |
# Similar as above - cvars like d_dbg* should not be committed to master | |
# so they're available to be used by other devs. | |
- run: '! ( grep --recursive --exclude-dir=target --exclude=debug.rs cvars\.d_dbg . && echo "The d_dbg* cvars should not be used in committed code. Maybe you forgot to remove debug code?" )' | |
# All paths should be lowercase of we might have issues | |
# when switching between case-sensitive and case-insensitive filesystems. | |
- run: '! ( find data | grep [A-Z] && echo "Asset names/paths must be all lowercase" )' |