From 44b2489037677f2341de4484acb000e92f15f40b Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Sun, 31 Mar 2024 13:42:40 -0700 Subject: [PATCH 1/2] ci: add minimal versions check Related to https://github.com/RustCrypto/elliptic-curves/issues/1038 --- .github/workflows/bign256.yml | 5 ++++ .github/workflows/bp256.yml | 21 +++++++++------ .github/workflows/bp384.yml | 21 +++++++++------ .github/workflows/check-minimal-versions.yml | 28 ++++++++++++++++++++ .github/workflows/k256.yml | 5 ++++ .github/workflows/p192.yml | 5 ++++ .github/workflows/p224.yml | 5 ++++ .github/workflows/p256.yml | 5 ++++ .github/workflows/p384.yml | 5 ++++ .github/workflows/p521.yml | 5 ++++ .github/workflows/primefield.yml | 15 +++++++---- .github/workflows/primeorder.yml | 21 +++++++++------ .github/workflows/sm2.yml | 5 ++++ 13 files changed, 117 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/check-minimal-versions.yml diff --git a/.github/workflows/bign256.yml b/.github/workflows/bign256.yml index f319e1af..2b30e4ac 100644 --- a/.github/workflows/bign256.yml +++ b/.github/workflows/bign256.yml @@ -112,3 +112,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: bign256 diff --git a/.github/workflows/bp256.yml b/.github/workflows/bp256.yml index 55c70453..1caca46c 100644 --- a/.github/workflows/bp256.yml +++ b/.github/workflows/bp256.yml @@ -52,14 +52,14 @@ jobs: - 1.73.0 # MSRV - stable steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo check --all-features - - run: cargo test --no-default-features - - run: cargo test - - run: cargo test --all-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - run: cargo check --all-features + - run: cargo test --no-default-features + - run: cargo test + - run: cargo test --all-features doc: runs-on: ubuntu-latest @@ -70,3 +70,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: bp256 diff --git a/.github/workflows/bp384.yml b/.github/workflows/bp384.yml index 9529fb6d..598c381b 100644 --- a/.github/workflows/bp384.yml +++ b/.github/workflows/bp384.yml @@ -52,14 +52,14 @@ jobs: - 1.73.0 # MSRV - stable steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo check --all-features - - run: cargo test --no-default-features - - run: cargo test - - run: cargo test --all-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - run: cargo check --all-features + - run: cargo test --no-default-features + - run: cargo test + - run: cargo test --all-features doc: runs-on: ubuntu-latest @@ -70,3 +70,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: bp384 diff --git a/.github/workflows/check-minimal-versions.yml b/.github/workflows/check-minimal-versions.yml new file mode 100644 index 00000000..0f2b23fc --- /dev/null +++ b/.github/workflows/check-minimal-versions.yml @@ -0,0 +1,28 @@ +# This workflow checks that the project builds and tests successfully with the +# minimal versions of all dependencies that are compatible with the current +# Cargo.lock file. This is useful for ensuring that the project is not +# accidentally relying on newer versions of dependencies than it actually +# needs. + +name: Check minimal versions + +on: + workflow_call: + inputs: + working-directory: + type: string + required: true +jobs: + check-minimal-versions: + defaults: + run: + working-directory: ${{ inputs.working-directory }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@nightly + - name: cargo update -Zminimal-versions + run: cargo +nightly update -Zdirect-minimal-versions + - name: cargo test + run: cargo test --locked --all-features --all-targets diff --git a/.github/workflows/k256.yml b/.github/workflows/k256.yml index 3ccb7997..ef8a3dd3 100644 --- a/.github/workflows/k256.yml +++ b/.github/workflows/k256.yml @@ -141,3 +141,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: k256 diff --git a/.github/workflows/p192.yml b/.github/workflows/p192.yml index 06e9fce1..cffa8ecc 100644 --- a/.github/workflows/p192.yml +++ b/.github/workflows/p192.yml @@ -82,3 +82,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: p192 diff --git a/.github/workflows/p224.yml b/.github/workflows/p224.yml index 102fab0c..77501c8c 100644 --- a/.github/workflows/p224.yml +++ b/.github/workflows/p224.yml @@ -84,3 +84,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: p224 diff --git a/.github/workflows/p256.yml b/.github/workflows/p256.yml index 854597c1..0330a399 100644 --- a/.github/workflows/p256.yml +++ b/.github/workflows/p256.yml @@ -125,3 +125,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: p256 diff --git a/.github/workflows/p384.yml b/.github/workflows/p384.yml index 999a2c37..2e282aa0 100644 --- a/.github/workflows/p384.yml +++ b/.github/workflows/p384.yml @@ -121,3 +121,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: p384 diff --git a/.github/workflows/p521.yml b/.github/workflows/p521.yml index f67b51d0..eb31cf21 100644 --- a/.github/workflows/p521.yml +++ b/.github/workflows/p521.yml @@ -91,3 +91,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: p521 diff --git a/.github/workflows/primefield.yml b/.github/workflows/primefield.yml index 2cb50a47..815e758c 100644 --- a/.github/workflows/primefield.yml +++ b/.github/workflows/primefield.yml @@ -45,11 +45,11 @@ jobs: - 1.73.0 # MSRV - stable steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo test + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - run: cargo test doc: runs-on: ubuntu-latest @@ -60,3 +60,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: primefield diff --git a/.github/workflows/primeorder.yml b/.github/workflows/primeorder.yml index 08407085..a8135aa3 100644 --- a/.github/workflows/primeorder.yml +++ b/.github/workflows/primeorder.yml @@ -46,14 +46,14 @@ jobs: - 1.73.0 # MSRV - stable steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - run: cargo check --all-features - - run: cargo test --no-default-features - - run: cargo test - - run: cargo test --all-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - run: cargo check --all-features + - run: cargo test --no-default-features + - run: cargo test + - run: cargo test --all-features doc: runs-on: ubuntu-latest @@ -64,3 +64,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: primeorder diff --git a/.github/workflows/sm2.yml b/.github/workflows/sm2.yml index b0fda8ca..97a30130 100644 --- a/.github/workflows/sm2.yml +++ b/.github/workflows/sm2.yml @@ -81,3 +81,8 @@ jobs: with: toolchain: stable - run: cargo doc --all-features + + check-minimal-versions: + uses: ./.github/workflows/check-minimal-versions.yml + with: + working-directory: sm2 From 44571a3400e11d15edd6e1e86abe5294cafea7bd Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Sun, 31 Mar 2024 18:25:29 -0700 Subject: [PATCH 2/2] ci: use RustCrypto/actions/.github/workflows/minimal-versions.yml@master --- .github/workflows/bign256.yml | 4 +-- .github/workflows/bp256.yml | 4 +-- .github/workflows/bp384.yml | 4 +-- .github/workflows/check-minimal-versions.yml | 28 -------------------- .github/workflows/k256.yml | 4 +-- .github/workflows/p192.yml | 4 +-- .github/workflows/p224.yml | 4 +-- .github/workflows/p256.yml | 4 +-- .github/workflows/p384.yml | 4 +-- .github/workflows/p521.yml | 4 +-- .github/workflows/primefield.yml | 4 +-- .github/workflows/primeorder.yml | 4 +-- .github/workflows/sm2.yml | 4 +-- 13 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/check-minimal-versions.yml diff --git a/.github/workflows/bign256.yml b/.github/workflows/bign256.yml index 2b30e4ac..8922c3ec 100644 --- a/.github/workflows/bign256.yml +++ b/.github/workflows/bign256.yml @@ -114,6 +114,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: bign256 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/bp256.yml b/.github/workflows/bp256.yml index 1caca46c..a812c708 100644 --- a/.github/workflows/bp256.yml +++ b/.github/workflows/bp256.yml @@ -72,6 +72,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: bp256 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/bp384.yml b/.github/workflows/bp384.yml index 598c381b..9b44de8f 100644 --- a/.github/workflows/bp384.yml +++ b/.github/workflows/bp384.yml @@ -72,6 +72,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: bp384 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/check-minimal-versions.yml b/.github/workflows/check-minimal-versions.yml deleted file mode 100644 index 0f2b23fc..00000000 --- a/.github/workflows/check-minimal-versions.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow checks that the project builds and tests successfully with the -# minimal versions of all dependencies that are compatible with the current -# Cargo.lock file. This is useful for ensuring that the project is not -# accidentally relying on newer versions of dependencies than it actually -# needs. - -name: Check minimal versions - -on: - workflow_call: - inputs: - working-directory: - type: string - required: true -jobs: - check-minimal-versions: - defaults: - run: - working-directory: ${{ inputs.working-directory }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: dtolnay/rust-toolchain@nightly - - name: cargo update -Zminimal-versions - run: cargo +nightly update -Zdirect-minimal-versions - - name: cargo test - run: cargo test --locked --all-features --all-targets diff --git a/.github/workflows/k256.yml b/.github/workflows/k256.yml index ef8a3dd3..0ae654d4 100644 --- a/.github/workflows/k256.yml +++ b/.github/workflows/k256.yml @@ -143,6 +143,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: k256 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/p192.yml b/.github/workflows/p192.yml index cffa8ecc..c371c4bf 100644 --- a/.github/workflows/p192.yml +++ b/.github/workflows/p192.yml @@ -84,6 +84,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: p192 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/p224.yml b/.github/workflows/p224.yml index 77501c8c..41586aa2 100644 --- a/.github/workflows/p224.yml +++ b/.github/workflows/p224.yml @@ -86,6 +86,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: p224 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/p256.yml b/.github/workflows/p256.yml index 0330a399..3a2a4d12 100644 --- a/.github/workflows/p256.yml +++ b/.github/workflows/p256.yml @@ -127,6 +127,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: p256 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/p384.yml b/.github/workflows/p384.yml index 2e282aa0..395f51c2 100644 --- a/.github/workflows/p384.yml +++ b/.github/workflows/p384.yml @@ -123,6 +123,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: p384 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/p521.yml b/.github/workflows/p521.yml index eb31cf21..9eddf9c9 100644 --- a/.github/workflows/p521.yml +++ b/.github/workflows/p521.yml @@ -93,6 +93,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: p521 + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/primefield.yml b/.github/workflows/primefield.yml index 815e758c..c70df964 100644 --- a/.github/workflows/primefield.yml +++ b/.github/workflows/primefield.yml @@ -62,6 +62,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: primefield + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/primeorder.yml b/.github/workflows/primeorder.yml index a8135aa3..ca8c940e 100644 --- a/.github/workflows/primeorder.yml +++ b/.github/workflows/primeorder.yml @@ -66,6 +66,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: primeorder + working-directory: ${{ github.workflow }} diff --git a/.github/workflows/sm2.yml b/.github/workflows/sm2.yml index 97a30130..cf534d3e 100644 --- a/.github/workflows/sm2.yml +++ b/.github/workflows/sm2.yml @@ -83,6 +83,6 @@ jobs: - run: cargo doc --all-features check-minimal-versions: - uses: ./.github/workflows/check-minimal-versions.yml + uses: RustCrypto/actions/.github/workflows/minimal-versions.yml@master with: - working-directory: sm2 + working-directory: ${{ github.workflow }}