Skip to content

Commit

Permalink
CI: Re-write using maintainer tools
Browse files Browse the repository at this point in the history
Re-write CI using the new maintainer tools script. A few things to note:

- 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.
  • Loading branch information
tcharding committed Aug 8, 2024
1 parent 766b934 commit ddf1209
Show file tree
Hide file tree
Showing 13 changed files with 501 additions and 243 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# rust-bitcoin 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 21 jobs but
`Prepare` is quick and must be run first anyway.

0. `Prepare`
1. `Stable - minimal`
2. `Stable - recent`
3. `Nightly - minimal`
4. `Nightly - recent`
5. `MSRV - minimal`
6. `MSRV - recent`
7. `Lint`
8. `Docs`
9. `Docsrs`
10. `Bench`
11. `Format`
12. `ASAN`
13. `Arch32Bit`
<!-- Jobs run from `cross.yaml` -->
14. `Cross testing - aarch64-unknown-linux-gnu`
15. `Cross testing - i686-unknown-linux-gnu`
16. `Cross testing - x86_64-pc-windows-gnu`
17. `Cross testing - x86_64-unknown-linux-gnu`
18. `Cross testing - aarch64-unknown-linux-musl`
19. `Cross testing - arm-unknown-linux-gnueabi`
20. `Cross testing - arm-unknown-linux-gnueabihf`
21. `Cross testing - armv7-unknown-linux-gnueabihf`
22. `Cross testing - powerpc-unknown-linux-gnu`
23. `Cross testing - powerpc64le-unknown-linux-gnu`
24. `Cross testing - riscv64gc-unknown-linux-gnu`
25. `Cross testing - s390x-unknown-linux-gnu`
26. `Cross testing - x86_64-unknown-linux-musl`
41 changes: 41 additions & 0 deletions .github/workflows/cron-semi-weekly-update-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update Nightly rustc
on:
schedule:
- cron: "0 0 * * 1,4" # runs every Monday and Thursday at 00:00
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Update nightly rustc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Update rust.yml to use latest nightly
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
- name: Create Pull Request
if: env.changes_made == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.APOELSTRA_CREATE_PR_TOKEN }}
author: Update Nightly Rustc Bot <[email protected]>
committer: Update Nightly Rustc Bot <[email protected]>
title: Automated daily update to rustc (to nightly-${{ env.nightly_date }})
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 }}
branch: create-pull-request/daily-nightly-update
Loading

0 comments on commit ddf1209

Please sign in to comment.