Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/checkout-maintainer-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Checkout Maintainer Tools
description: Checks out the rust-bitcoin maintainer tools repo
runs:
using: "composite"
steps:
- name: Checkout maintainer tools
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
ref: f92b2766865ce5327eca5cf72f86ceaa6be58ca4
path: maintainer-tools
171 changes: 171 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- master
- 'test-ci/**'

name: Continuous integration

jobs:
Prepare:
runs-on: ubuntu-latest
outputs:
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
msrv_version: ${{ steps.read_msrv.outputs.msrv_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Read nightly version"
id: read_toolchain
run: |
set -euo pipefail
version=$(cat nightly-version)
echo "nightly_version=$version" >> $GITHUB_OUTPUT
- name: Read MSRV from clippy.toml
id: read_msrv
run: |
set -euo pipefail
msrv=$(grep '^msrv *= *"' clippy.toml | sed -E 's/.*"([^"]+)".*/\1/')
echo "msrv_version=$msrv" >> "$GITHUB_OUTPUT"

Stable:
name: Test - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh stable

Nightly:
name: Test - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh nightly

MSRV:
name: Test - MSRV
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ needs.Prepare.outputs.msrv_version }}
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh msrv

Lint:
name: Lint - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: Install clippy
run: rustup component add clippy
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh lint

Docs:
name: Docs - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docs

Docsrs:
name: Docs - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docsrs

Format:
name: Format - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: "Install rustfmt"
run: rustup component add rustfmt
- name: "Check formatting"
run: cargo fmt --all -- --check

Wasm:
name: Check WASM
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- run: rustup target add wasm32-unknown-unknown
- run: cargo check --target wasm32-unknown-unknown
154 changes: 0 additions & 154 deletions .github/workflows/test.yml

This file was deleted.

9 changes: 9 additions & 0 deletions contrib/crates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Sourced by `rust-bitcoin-maintainer-tools/ci/run_task.sh`.
#
# No shebang, this file should not be executed.
# shellcheck disable=SC2148
#
# disable verify unused vars, despite the fact that they are used when sourced
# shellcheck disable=SC2034

CRATES=(. codegen)
Loading