winit_input_helper 0.17.0

Processes winit events, allowing input state to be queried at any time.
Documentation
name: Testing

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

# Cancel already running jobs
concurrency:
  group: testing_${{ github.head_ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    strategy:
      matrix:
        include:
          - name: Release
            cargo_profile: --release
          - name: Debug
            cargo_profile:
    name: ${{ matrix.name }}
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: Swatinem/rust-cache@v2
      with:
        # rust-cache already handles all the sane defaults for caching rust builds.
        # However because we are running seperate debug/release builds in parallel,
        # we also need to add Debug or Release to the key so that a seperate cache is used.
        # Otherwise only the last build to finish would get saved to the cache.
        key: ${{ matrix.name }}
    - name: Install cargo-hack
      uses: taiki-e/install-action@v2
      with:
        tool: cargo-hack@0.6.22
    - name: Check `cargo fmt` was run
      run: cargo fmt --all -- --check
    # If your library does not support running under every possible combination of features,
    # consider using cargo `hack --each-feature` or some other combination of arguments as described at https://github.com/taiki-e/cargo-hack
    - name: Ensure that the library and all examples compile and have no warnings under every possible combination of features
      # some things to explicitly point out:
      # * clippy also reports rustc warnings and errors
      # * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
      run: cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_profile }} -- -D warnings
    - name: Ensure that tests pass under every possible combination of features
      run: cargo hack --feature-powerset test ${{ matrix.cargo_profile }}
    - name: Ensure that tests did not create or modify any files that arent .gitignore'd
      # This is important because we are checking in the Cargo.lock file.
      # We want to fail CI if the Cargo.toml changed without including the corresponding Cargo.lock changes.
      # Its also just generally nice to ensure your tests dont leave around unexpected files.
      shell: bash
      run: |
        if [ -n "$(git status --porcelain)" ]; then
          git status
          exit 1
        fi