Skip to content

Commit 41a6d43

Browse files
committed
Merge #699: CI: Re-write using maintainer tools
aee0cfc CI: Re-write using maintainer tools (Tobin C. Harding) 89facea Rewrite cross to use dtolnay runner (Tobin C. Harding) 0668943 CI: Remove cross job (Tobin C. Harding) Pull request description: Patch 1 is now on its own in #728 Re-write CI using the new maintainer tools script. A few things to note: - Currently we have `Cross` job in `rust.yaml` as well as `cross.yaml`, remove the one in `rust.yaml`. - Put sanitizer and wasm jobs in their own scripts - Utilize `extra_tests.sh` for additional feature combos - We are exceeding the 20 job limit, see the README Unless I'm made a mistake this shouldn't reduce the test coverage in any way (except sanitizer mentioned below). I commented out the MSAN stuff same as we did in `hashes`. I'm not sure what is the status of that but it seems to be failing still - did not look into it. Please note, I do not know _why_ the xargo stuff is run from in the ASAN job currently, but this PR keep it that way - adding it to the `sanitizer.sh` script. ACKs for top commit: storopoli: ACK aee0cfc apoelstra: ACK aee0cfc successfully ran local tests Tree-SHA512: ab828c19c9189bb3af7e517deafca1adf606d3e9db81a890b12125bb9923b6f9f3b8e2ab7afc538aa58aa62958e38f07e6418ccfa985c06595a1b6dbeca247b6
2 parents a3aa0d9 + aee0cfc commit 41a6d43

15 files changed

+572
-269
lines changed

.github/workflows/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# rust-bitcoin workflow notes
2+
3+
We are attempting to run max 20 parallel jobs using GitHub actions (usage limit for free tier).
4+
5+
ref: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
6+
7+
The minimal/recent lock files are handled by CI (`rust.yml`).
8+
9+
## Jobs
10+
11+
Run from `rust.yml` unless stated otherwise. Total 21 jobs but
12+
`Prepare` is quick and must be run first anyway.
13+
14+
0. `Prepare`
15+
1. `Stable - minimal`
16+
2. `Stable - recent`
17+
3. `Nightly - minimal`
18+
4. `Nightly - recent`
19+
5. `MSRV - minimal`
20+
6. `MSRV - recent`
21+
7. `Lint`
22+
8. `Docs`
23+
9. `Docsrs`
24+
10. `Bench`
25+
11. `Format`
26+
12. `ASAN`
27+
13. `Arch32Bit`
28+
14. `WASM`
29+
15. `NoStd`
30+
<!-- Jobs run from `cross.yaml` -->
31+
16. `Cross testing - aarch64-unknown-linux-gnu`
32+
17. `Cross testing - i686-unknown-linux-gnu`
33+
18. `Cross testing - x86_64-pc-windows-gnu`
34+
19. `Cross testing - x86_64-unknown-linux-gnu`
35+
20. `Cross testing - aarch64-unknown-linux-musl`
36+
21. `Cross testing - arm-unknown-linux-gnueabi`
37+
22. `Cross testing - arm-unknown-linux-gnueabihf`
38+
23. `Cross testing - armv7-unknown-linux-gnueabihf`
39+
24. `Cross testing - powerpc-unknown-linux-gnu`
40+
25. `Cross testing - powerpc64le-unknown-linux-gnu`
41+
26. `Cross testing - riscv64gc-unknown-linux-gnu`
42+
27. `Cross testing - s390x-unknown-linux-gnu`
43+
28. `Cross testing - x86_64-unknown-linux-musl`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update Nightly rustc
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 1,4" # runs every Monday and Thursday at 00:00
5+
workflow_dispatch: # allows manual triggering
6+
jobs:
7+
format:
8+
name: Update nightly rustc
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: dtolnay/rust-toolchain@nightly
13+
- name: Update rust.yml to use latest nightly
14+
run: |
15+
set -x
16+
# Not every night has a nightly, so extract the date from whatever
17+
# version of the compiler dtolnay/rust-toolchain gives us.
18+
NIGHTLY_DATE=$(rustc +nightly --verbose --version | sed -ne 's/^commit-date: //p')
19+
# Update the nightly version in the reference file.
20+
echo "nightly-${NIGHTLY_DATE}" > nightly-version
21+
echo "nightly_date=${NIGHTLY_DATE}" >> $GITHUB_ENV
22+
# Some days there is no new nightly. In this case don't make an empty PR.
23+
if ! git diff --exit-code > /dev/null; then
24+
echo "Updated nightly. Opening PR."
25+
echo "changes_made=true" >> $GITHUB_ENV
26+
else
27+
echo "Attempted to update nightly but the latest-nightly date did not change. Not opening any PR."
28+
echo "changes_made=false" >> $GITHUB_ENV
29+
fi
30+
- name: Create Pull Request
31+
if: env.changes_made == 'true'
32+
uses: peter-evans/create-pull-request@v6
33+
with:
34+
token: ${{ secrets.APOELSTRA_CREATE_PR_TOKEN }}
35+
author: Update Nightly Rustc Bot <[email protected]>
36+
committer: Update Nightly Rustc Bot <[email protected]>
37+
title: Automated daily update to rustc (to nightly-${{ env.nightly_date }})
38+
body: |
39+
Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
40+
commit-message: Automated update to Github CI to rustc nightly-${{ env.nightly_date }}
41+
branch: create-pull-request/daily-nightly-update

.github/workflows/cross.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,16 @@ jobs:
3737
- x86_64-unknown-linux-musl
3838
# - x86_64-unknown-netbsd # error in tests "error: test failed, to rerun pass '--lib'", disabled for now
3939
steps:
40-
- name: Checkout Crate
41-
uses: actions/checkout@v2
40+
- name: "Checkout repo"
41+
uses: actions/checkout@v4
4242
- uses: Swatinem/[email protected]
4343
with:
4444
key: ${{ matrix.feature }}${{ matrix.os }}
45-
- name: Checkout Toolchain
46-
uses: actions-rs/toolchain@v1
47-
with:
48-
profile: minimal
49-
toolchain: stable
50-
override: true
51-
- name: Install target
45+
- name: "Select toolchain"
46+
uses: dtolnay/rust-toolchain@stable
47+
- name: "Install target"
5248
run: rustup target add ${{ matrix.arch }}
53-
- name: install cross
49+
- name: "Install cross"
5450
run: cargo install cross
55-
- name: run cross test
51+
- name: "Run cross test"
5652
run: cross test --target ${{ matrix.arch }} --verbose

0 commit comments

Comments
 (0)