refactor(test): prefer cfg_attr(ignore) over cfg for conditional test skipping
#2166
Workflow file for this run
This file contains hidden or 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: Test | |
| on: | |
| - push | |
| - pull_request | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache | |
| uses: actions/cache@v5 | |
| timeout-minutes: 2 | |
| continue-on-error: true | |
| if: matrix.os != 'macos-latest' # Cache causes errors on macOS | |
| with: | |
| path: | | |
| ~/.cargo | |
| target | |
| key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('**/Cargo.lock') }} | |
| ${{ github.job }}-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}- | |
| - name: Install Rust | |
| shell: bash | |
| run: | | |
| installer=$(mktemp -d)/install-rustup | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $installer | |
| bash $installer --default-toolchain $(cat rust-toolchain) -y | |
| - name: Test (dev) | |
| shell: bash | |
| env: | |
| FMT: 'false' | |
| LINT: 'false' | |
| DOC: 'true' | |
| BUILD: 'true' | |
| TEST: 'true' | |
| BUILD_FLAGS: '--locked' | |
| TEST_FLAGS: '--no-fail-fast' | |
| run: ./test.sh | |
| - name: Test (release) | |
| shell: bash | |
| env: | |
| RUSTFLAGS: '-D warnings' | |
| RUSTDOCFLAGS: '-D warnings' | |
| FMT: 'false' | |
| LINT: 'false' | |
| DOC: 'true' | |
| BUILD: 'true' | |
| TEST: 'true' | |
| BUILD_FLAGS: '--locked' | |
| TEST_FLAGS: '--no-fail-fast' | |
| run: ./test.sh --release |