|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +env: |
| 5 | + RUSTDOCFLAGS: -D warnings |
| 6 | + RUSTFLAGS: -D warnings |
| 7 | + |
| 8 | +jobs: |
| 9 | + clippy: |
| 10 | + name: clippy |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + - name: Install Rust |
| 15 | + run: | |
| 16 | + rustup update nightly --no-self-update |
| 17 | + rustup default nightly |
| 18 | + rustup component add clippy |
| 19 | + - uses: Swatinem/rust-cache@v2 |
| 20 | + # FIXME: enable once there is code |
| 21 | + # - run: cargo clippy --all-features --all-targets -- -D warnings |
| 22 | + |
| 23 | + test: |
| 24 | + name: test |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: Install Rust |
| 29 | + run: | |
| 30 | + rustup update nightly --no-self-update |
| 31 | + rustup default nightly |
| 32 | + rustup component add clippy |
| 33 | + - uses: Swatinem/rust-cache@v2 |
| 34 | + # FIXME: enable once there is code |
| 35 | + # - run: cargo test |
| 36 | + |
| 37 | + rustfmt: |
| 38 | + name: rustfmt |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@master |
| 42 | + - name: Install Rust |
| 43 | + run: | |
| 44 | + rustup update nightly --no-self-update |
| 45 | + rustup default nightly |
| 46 | + rustup component add rustfmt |
| 47 | + # FIXME: enable once there is code |
| 48 | + # - run: cargo fmt --all -- --check |
| 49 | + |
| 50 | + doc: |
| 51 | + name: docs |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - run: | |
| 56 | + rustup update nightly --no-self-update |
| 57 | + rustup default nightly |
| 58 | + - uses: Swatinem/rust-cache@v2 |
| 59 | + # FIXME: enable once there is code |
| 60 | + # - run: cargo doc |
| 61 | + |
| 62 | + success: |
| 63 | + needs: |
| 64 | + - clippy |
| 65 | + - test |
| 66 | + - rustfmt |
| 67 | + - doc |
| 68 | + runs-on: ubuntu-latest |
| 69 | + # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency |
| 70 | + # failed" as success. So we have to do some contortions to ensure the job fails if any of its |
| 71 | + # dependencies fails. |
| 72 | + if: always() # make sure this is never "skipped" |
| 73 | + steps: |
| 74 | + # Manually check the status of all dependencies. `if: failure()` does not work. |
| 75 | + - name: check if any dependency failed |
| 76 | + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments