Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Use run_task from maintainer tools #682

Merged
merged 4 commits into from
Jul 14, 2024
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
24 changes: 24 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# rust-miniscript workflow notes

We are attempting to run max 20 parallel jobs using GitHub actions (usage limit for free tier).

ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration

The minimal/recent lock files are handled by CI (`rust.yml`).

## Jobs

Run from `rust.yml` unless stated otherwise. Total 11 jobs.

1. `Stable - minimal`
2. `Stable - recent`
3. `Nightly - minimal`
4. `Nightly - recent`
5. `MSRV - minimal`
6. `Lint`
7. `Docs`
8. `Docsrs`
9. `Bench`
10. `Format`
10. `Int-tests`
11. `Embedded`
227 changes: 174 additions & 53 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,201 @@
on: [push, pull_request]
--- # rust-miniscript CI: If you edit this file please update README.md
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- 'test-ci/**'
pull_request:

name: Continuous integration

jobs:
Nightly:
name: Nightly - Bench + Docs + Fmt
Stable: # 2 jobs, one per lock file.
name: Test - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [minimal, recent]
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
profile: minimal
toolchain: nightly
override: true
- name: Install clippy
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- 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.
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: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh nightly

MSRV: # 1 jobs, minimal lock file only.
name: Test - 1.56.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [minimal]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.56.1"
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh msrv

Lint:
name: Lint - nightly 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: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Install clippy"
run: rustup component add clippy
- name: Running benchmarks
env:
DO_BENCH: true
run: ./contrib/test.sh
- name: Building docs
env:
DO_DOCS: true
run: ./contrib/test.sh
- name: Running formatter
env:
DO_FMT: true
run: ./contrib/test.sh
- name: Running linter
env:
DO_LINT: true
run: ./contrib/test.sh
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh lint

Int-tests:
name: Integration tests
Docs:
name: Docs - stable toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dep: [recent]
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
profile: minimal
toolchain: stable
override: true
- name: Running integration tests
env:
DO_BITCOIND_TESTS: true
run: ./contrib/test.sh
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- 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 docs

Docsrs:
name: Docs - nightly 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: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh docsrs

Tests:
name: Tests
Bench:
name: Bench - nightly toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
- rust: "1.56.1"
dep: [recent]
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout maintainer tools"
uses: actions/checkout@v4
with:
repository: rust-bitcoin/rust-bitcoin-maintainer-tools
path: maintainer-tools
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Set dependencies"
run: cp Cargo-${{ matrix.dep }}.lock Cargo.lock
- name: "Run test script"
run: ./maintainer-tools/ci/run_task.sh bench

Format: # 1 jobs, run cargo fmt directly.
name: Format - nightly toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@nightly
- name: "Install rustfmt"
run: rustup component add rustfmt
- name: "Check formatting"
run: cargo +nightly fmt --all -- --check

Int-tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: stable
override: true
- name: Running cargo
env:
DO_FEATURE_MATRIX: true
DO_NO_STD: true
run: ./contrib/test.sh
- name: Running integration tests
run: ./contrib/integration_test.sh

Embedded:
runs-on: ubuntu-latest
Expand Down
Loading
Loading