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
41 changes: 41 additions & 0 deletions .github/workflows/cron-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: "5 0 * * 6" # Saturday at 00:05
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Update nightly rustc
runs-on: ubuntu-24.04
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@v7
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 }})
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
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ on: [push, pull_request]
name: Continuous integration

jobs:
Prepare:
runs-on: ubuntu-24.04
outputs:
nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }}
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Read nightly version"
id: read_toolchain
run: echo "nightly_version=$(cat nightly-version)" >> $GITHUB_OUTPUT

fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,14 +57,15 @@ jobs:

test:
name: Tests
needs: Prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
- beta
- nightly
- ${{ needs.Prepare.outputs.nightly_version }}
- 1.78.0
steps:
- name: Checkout Crate
Expand Down Expand Up @@ -122,12 +134,15 @@ jobs:

docs:
name: Docs
needs: Prepare
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ needs.Prepare.outputs.nightly_version }}
- name: Check that documentation builds without errors
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links"
Expand Down
1 change: 1 addition & 0 deletions nightly-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nightly-2025-04-11