Skip to content

Commit

Permalink
Merge pull request #7 from indexmap-rs/ci
Browse files Browse the repository at this point in the history
Add a CI workflow
  • Loading branch information
cuviper authored Jan 22, 2025
2 parents 8a56bf0 + 6b566dd commit 9e98ca7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:

name: CI

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- rust: 1.6.0 # MSRV
- rust: stable
- rust: beta
- rust: nightly

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Tests
run: |
cargo build --verbose
cargo test --verbose
# One job that "summarizes" the success state of this pipeline. This can then be added to branch
# protection, rather than having to add each job separately.
success:
name: Success
runs-on: ubuntu-latest
needs: [tests]
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 comments on commit 9e98ca7

Please sign in to comment.