Use rust-bitcoin-maintainer-tools and re-write CI #337
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
- 'test-ci/**' | |
pull_request: | |
name: Continuous integration | |
jobs: | |
Prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
crates: ${{ steps.get_matrix.outputs.crates }} | |
deps: ${{ steps.get_matrix.outputs.deps }} | |
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }} | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: "Checkout maintainer tools" | |
uses: actions/checkout@v4 | |
with: | |
repository: tcharding/rust-bitcoin-maintainer-tools | |
ref: 05-02-ci | |
path: maintainer-tools | |
- name: "Read nightly version" | |
id: read_toolchain | |
run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT | |
- name: "Prepare tests" | |
id: get_matrix | |
run: ./maintainer-tools/ci/get_matrix.sh | |
Stable: # 2 jobs, one per lock file. | |
needs: Prepare | |
name: Test - stable toolchain | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dep: [minimal, recent] | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: "Select toolchain" | |
uses: dtolnay/rust-toolchain@stable | |
- name: "Set dependencies" | |
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | |
- name: "Run test script" | |
run: ./maintainer-tools/ci/run_task.sh stable | |
Nightly: # 2 jobs, one per lock file. | |
needs: Prepare | |
name: Test - nightly toolchain | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dep: [minimal, recent] | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: "Select toolchain" | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ needs.Prepare.outputs.nightly_version }} | |
- name: "Set dependencies" | |
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | |
- name: "Run test script" | |
run: ./maintainer-tools/ci/run_task.sh nightly | |
MSRV: # 2 jobs, one per lock file. | |
needs: Prepare | |
name: Test - 1.56.1 toolchain | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dep: [minimal, recent] | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: "Select toolchain" | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: "1.56.1" | |
- name: "Copy lock file" | |
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | |
- name: "Run test script" | |
run: ./maintainer-tools/ci/run_task.sh msrv | |
Format: # 1 jobs, uses recent lock file. | |
needs: Prepare | |
name: Format - stable toolchain | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dep: [recent] | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: "Select toolchain" | |
uses: dtolnay/rust-toolchain@stable | |
- name: "Set dependencies" | |
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock | |
- name: "Check formatting" | |
run: ./maintainer-tools/ci/run_task.sh fmt |