Merge rust-bitcoin/rust-bitcoin#1509: Use dtonlnay instead of actions-rs

4201612837 Use dtonlnay instead of actions-rs (Tobin C. Harding)

Pull request description:

  Done on top of #1508

  Currently we use the `actions-rs` GitHub action to run our tests. It seems the project is now unmaintained [0].

  Well known Rust developer dtonlnay maintains a GitHub action that can be used instead.

  Replace all uses of `actions-rs/toolchain` with `dtonlnay/rust-toolchain`. Note that with the new action there is no way to configure the toolchain, instead a different `uses` statement is required - this means we have to split our jobs up by toolchain. This is arguably cleaner anyways.

  Note that with this patch applied the "no-std" tests are now _not_ run for MSRV since we explicitly support "no-std" only for the 1.47 and above toolchains - strange that this was working?

  [0] https://github.com/actions-rs/toolchain/issues/216

ACKs for top commit:
  sanket1729:
    ACK 4201612837. Verified that we did not miss any checks in the translation.
  elichai:
    ACK 4201612837

Tree-SHA512: 117b35953c7e0d93ff1ea76fbff948d9a50aff9b3d0854beced540321f84eb83510af23067ff2ebc29b8d9c59b3ca205beeecde6e968bc619e21430b951f02cb
This commit is contained in:
Andrew Poelstra 2022-12-30 14:22:28 +00:00
commit bd7ae6d5e9
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 93 additions and 70 deletions

View File

@ -3,14 +3,18 @@ on: [push, pull_request]
name: Continuous integration name: Continuous integration
jobs: jobs:
Tests: Stable:
name: Tests name: Test - stable toolchain
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: steps:
include: - name: Checkout Crate
- rust: stable uses: actions/checkout@v3
- name: Checkout Toolchain
# https://github.com/dtolnay/rust-toolchain
uses: dtolnay/rust-toolchain@stable
- name: Running test script
env: env:
DO_COV: true DO_COV: true
DO_LINT: true DO_LINT: true
@ -18,48 +22,80 @@ jobs:
DO_NO_STD: true DO_NO_STD: true
DO_FEATURE_MATRIX: true # Currently only used in hashes crate. DO_FEATURE_MATRIX: true # Currently only used in hashes crate.
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate. DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
- rust: beta run: ./contrib/test.sh
Beta:
name: Test - beta toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@beta
- name: Running test script
env: env:
AS_DEPENDENCY: false AS_DEPENDENCY: false
DO_NO_STD: true DO_NO_STD: true
- rust: nightly run: ./contrib/test.sh
Nightly:
name: Test - nightly toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Running test script
env: env:
DO_BENCH: true DO_BENCH: true
AS_DEPENDENCY: false AS_DEPENDENCY: false
DO_NO_STD: true DO_NO_STD: true
DO_DOCS: true DO_DOCS: true
- rust: 1.41.1 run: ./contrib/test.sh
env:
AS_DEPENDENCY: false MSRV:
- rust: 1.47 name: Test - 1.41.1 toolchain
env: runs-on: ubuntu-latest
AS_DEPENDENCY: false strategy:
DO_NO_STD: true fail-fast: false
steps: steps:
- name: Checkout Crate - name: Checkout Crate
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@1.41.1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Running test script - name: Running test script
env: ${{ matrix.env }} env:
DO_FEATURE_MATRIX: true # Currently only used in hashes crate.
run: ./contrib/test.sh
NoStd:
name: Test - 1.47 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@1.47
- name: Running test script
env:
DO_NO_STD: true
run: ./contrib/test.sh run: ./contrib/test.sh
Arch32bit: Arch32bit:
name: Testing 32-bit version name: Test 32-bit version
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Crate - name: Checkout Crate
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- name: Add architecture i386 - name: Add architecture i386
run: sudo dpkg --add-architecture i386 run: sudo dpkg --add-architecture i386
- name: Install i686 gcc - name: Install i686 gcc
@ -70,18 +106,14 @@ jobs:
run: cargo test --target i686-unknown-linux-gnu run: cargo test --target i686-unknown-linux-gnu
Cross: Cross:
name: Cross testing name: Cross test
if: ${{ !github.event.act }} if: ${{ !github.event.act }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Crate - name: Checkout Crate
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- name: Install target - name: Install target
run: rustup target add s390x-unknown-linux-gnu run: rustup target add s390x-unknown-linux-gnu
- name: install cross - name: install cross
@ -96,17 +128,15 @@ jobs:
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel" CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up QEMU - name: Set up QEMU
run: sudo apt update && sudo apt install -y qemu-system-arm gcc-arm-none-eabi run: sudo apt update && sudo apt install -y qemu-system-arm gcc-arm-none-eabi
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@nightly
with: with:
profile: minimal targets: thumbv7m-none-eabi
toolchain: nightly - name: Install src
override: true run: rustup component add rust-src
components: rust-src
target: thumbv7m-none-eabi
- name: Run bitcoin/embedded - name: Run bitcoin/embedded
run: cd bitcoin/embedded && cargo run --target thumbv7m-none-eabi run: cd bitcoin/embedded && cargo run --target thumbv7m-none-eabi
- name: Run hashes/embedded no alloc - name: Run hashes/embedded no alloc
@ -119,14 +149,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Crate - name: Checkout Crate
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@nightly
with: - name: Install src
profile: minimal run: rustup component add rust-src
toolchain: nightly
override: true
components: rust-src
- name: Running address sanitizer - name: Running address sanitizer
env: env:
DO_ASAN: true DO_ASAN: true
@ -137,13 +164,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Crate - name: Checkout Crate
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Checkout Toolchain - name: Checkout Toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- name: Running WASM build - name: Running WASM build
env: env:
DO_WASM: true DO_WASM: true