diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3b66850..779aeb4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,9 +1,5 @@ name: CI -on: - push: - branches: - - staging - - trying +on: merge_group jobs: @@ -21,7 +17,12 @@ jobs: nightly ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} @@ -33,7 +34,7 @@ jobs: name: No Std runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: target: thumbv6m-none-eabi @@ -43,8 +44,23 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.62.0 with: components: rustfmt - run: cargo fmt --all --check + + # 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: [test, no_std, fmt] + # 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) }}' diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index 98e8f8e..68c4900 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -15,7 +15,12 @@ jobs: matrix: rust: [1.31.0, stable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d221a73..787f908 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -11,7 +11,12 @@ jobs: matrix: rust: [1.31.0, stable] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} @@ -22,8 +27,23 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.62.0 with: components: rustfmt - run: cargo fmt --all --check + + # 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: [test, fmt] + # 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) }}' diff --git a/Cargo.toml b/Cargo.toml index b017e3f..39de2df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ name = "num-complex" repository = "https://github.com/rust-num/num-complex" version = "0.4.4" readme = "README.md" -exclude = ["/bors.toml", "/ci/*", "/.github/*"] +exclude = ["/ci/*", "/.github/*"] edition = "2018" [package.metadata.docs.rs] diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 67d134f..0000000 --- a/bors.toml +++ /dev/null @@ -1,10 +0,0 @@ -status = [ - "Test (1.31.0)", - "Test (1.36.0)", - "Test (1.54.0)", - "Test (stable)", - "Test (beta)", - "Test (nightly)", - "No Std", - "Format", -] diff --git a/ci/test_full.sh b/ci/test_full.sh index 60e9740..4b29bb7 100755 --- a/ci/test_full.sh +++ b/ci/test_full.sh @@ -40,6 +40,7 @@ check_version 1.43 || cargo update -p libm --precise 0.2.5 # Some crates moved to Rust 1.56 / 2021 check_version 1.56 || ( + cargo update -p serde --precise 1.0.185 cargo update -p quote --precise 1.0.30 cargo update -p proc-macro2 --precise 1.0.65 cargo update -p rkyv --precise 0.7.40