Skip to content
Open
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: 0 additions & 11 deletions .github/actions/checkout-maintainer-tools/action.yml

This file was deleted.

44 changes: 19 additions & 25 deletions .github/workflows/cron-weekly-update-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
name: Update Nightly rustc
on:
schedule:
- cron: "5 0 * * 1" # runs every Monday at 00:05 UTC
- cron: "5 0 * * 6" # Saturday at 00:05
workflow_dispatch: # allows manual triggering
permissions: {}
jobs:
format:
name: Update nightly rustc
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Update rust.yml to use latest nightly
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install cargo-rbmt
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
- name: Update nightly toolchain in Cargo.toml
run: |
set -x
# Not every night has a nightly, so extract the date from whatever
# version of the compiler dtolnay/rust-toolchain gives us.
NIGHTLY_DATE=$(rustc +nightly --verbose --version | sed -ne 's/^commit-date: //p')
# Update the nightly version in the reference file.
echo "nightly-${NIGHTLY_DATE}" > nightly-version
echo "nightly_date=${NIGHTLY_DATE}" >> $GITHUB_ENV
# Some days there is no new nightly. In this case don't make an empty PR.
if ! git diff --exit-code > /dev/null; then
echo "Updated nightly. Opening PR."
echo "changes_made=true" >> $GITHUB_ENV
else
echo "Attempted to update nightly but the latest-nightly date did not change. Not opening any PR."
echo "changes_made=false" >> $GITHUB_ENV
fi
eval "$(cargo rbmt toolchains --update-nightly)"
echo "nightly_version=$RBMT_NIGHTLY" >> $GITHUB_ENV
- name: Create Pull Request
if: env.changes_made == 'true'
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.APOELSTRA_CREATE_PR_TOKEN }}
author: Update Nightly Rustc Bot <bot@example.com>
committer: Update Nightly Rustc Bot <bot@example.com>
title: Automated daily update to rustc (to nightly-${{ env.nightly_date }})
title: Automated daily update to rustc (to ${{ env.nightly_version }})
body: |
Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: Automated update to Github CI to rustc nightly-${{ env.nightly_date }}
Automated update to Cargo.toml workspace metadata by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: Automated update to rustc ${{ env.nightly_version }}
branch: create-pull-request/daily-nightly-update
34 changes: 34 additions & 0 deletions .github/workflows/cron-weekly-update-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update Stable rustc
on:
schedule:
- cron: "0 0 * * 5" # runs every Friday at 00:00 (generally rust releases on Thursday)
workflow_dispatch: # allows manual triggering
permissions: {}
jobs:
format:
name: Update stable rustc
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install cargo-rbmt
run: cargo install --git https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools.git --rev $(cat rbmt-version) cargo-rbmt
- name: Update stable toolchain in Cargo.toml
run: |
eval "$(cargo rbmt toolchains --update-stable)"
echo "stable_version=$RBMT_STABLE" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.APOELSTRA_CREATE_PR_TOKEN }}
author: Update Stable Rustc Bot <bot@example.com>
committer: Update Stable Rustc Bot <bot@example.com>
title: Automated weekly update to rustc stable (to ${{ env.stable_version }})
body: |
Automated update to Cargo.toml workspace metadata by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: Automated update to rustc stable-${{ env.stable_version }}
branch: create-pull-request/weekly-stable-update
235 changes: 91 additions & 144 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,173 +1,120 @@
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- master
- 'test-ci/**'
on: [push, pull_request]

name: Continuous integration
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: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- 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: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh nightly
permissions:
contents: read

MSRV:
name: Test - MSRV
needs: Prepare
runs-on: ubuntu-latest
jobs:
Test: # 6 jobs: 3 toolchains × 2 lock files.
name: Test - ${{ matrix.toolchain }} toolchain (${{ matrix.dep }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
dep: [recent]
toolchain: [stable, nightly, msrv]
steps:
- name: "Checkout repo"
- 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: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh msrv
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
- uses: Swatinem/rust-cache@v2
- name: Run ${{ matrix.toolchain }} tests
run: |
export ELEMENTSD_EXE="$PWD/elementsd-tests/bin/elementsd"
if [ "${{ matrix.toolchain }}" = "msrv" ]; then
MSRV="$(cargo rbmt toolchains --msrv)"
cp "Cargo-${{ matrix.dep }}.lock" Cargo.lock
cargo +"$MSRV" test --locked
else
cargo rbmt --lock-file ${{ matrix.dep }} test --toolchain ${{ matrix.toolchain }}
fi

Lint:
name: Lint - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
runs-on: ubuntu-24.04
steps:
- name: "Checkout repo"
- name: Checkout Crate
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: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh lint
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
- uses: Swatinem/rust-cache@v2
- name: Run lints
run: cargo rbmt --lock-file recent lint

Docs:
name: Docs - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
runs-on: ubuntu-24.04
steps:
- name: "Checkout repo"
- name: Checkout Crate
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: ./.github/actions/checkout-maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
- name: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docs
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
- uses: Swatinem/rust-cache@v2
- name: Run doc tests
run: cargo rbmt --lock-file recent docs

Docsrs:
name: Docs - nightly toolchain
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
runs-on: ubuntu-24.04
steps:
- name: "Checkout repo"
- name: Checkout Crate
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: "Set dependencies"
run: cp Cargo-latest.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docsrs
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
- uses: Swatinem/rust-cache@v2
- name: Run docsrs tests
run: cargo rbmt --lock-file recent docsrs

# Format:
# Format: # 1 job, run cargo fmt directly.
# name: Format - nightly toolchain
# needs: Prepare
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# runs-on: ubuntu-24.04
# steps:
# - name: "Checkout repo"
# - name: Checkout Crate
# 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
# - uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
# - name: Check formatting
# run: cargo rbmt --lock-file recent fmt --check

Bench:
name: Bench - nightly toolchain
runs-on: ubuntu-24.04
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- uses: rust-bitcoin/rust-bitcoin-maintainer-tools/.github/actions/setup-rbmt@af3c2868415b17eedc808da6d0589e10b7482660 # v0.1.0
- uses: Swatinem/rust-cache@v2
- name: Run benches
run: cargo rbmt --lock-file recent bench

Arch32bit:
name: Test 32-bit version
runs-on: ubuntu-24.04
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add architecture i386
run: sudo dpkg --add-architecture i386
- name: Install i686 gcc
run: sudo apt-get update -y && sudo apt-get install -y gcc-multilib
- name: Install target
run: rustup target add i686-unknown-linux-gnu
- name: Run tests on i686
run: cargo test --target i686-unknown-linux-gnu

Cross:
name: Cross test
runs-on: ubuntu-24.04
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install target
run: rustup target add s390x-unknown-linux-gnu
- name: install cross
run: cargo install cross --locked
- name: run cross test
run: cross test --target s390x-unknown-linux-gnu

Wasm:
name: Check WASM
Expand Down
File renamed without changes.
Loading
Loading