Skip to content

Commit

Permalink
chore(ci): Do not test nightly rust on every PR (#1940)
Browse files Browse the repository at this point in the history
## Description

Normal CI jobs for PRs now only run using the stable rust compiler,
this gives fewer surprises to users.

Instead the beta compiler is run in a new workflow which runs once a
week.  When the beta workflow fails we get a post in a discord channel.

## Notes & open questions

The required checks for branch protection have changed again.  We no
longer need the nightly checks in those.

## Change checklist

- [x] Self-review.
  • Loading branch information
flub authored Jan 11, 2024
1 parent 41f056b commit eab55bf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/beta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Run tests using the beta Rust compiler

name: Beta Rust

on:
schedule:
# 06:50 UTC every Monday
- cron: '50 6 * * 1'
workflow_dispatch:

concurrency:
group: beta-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
uses: './.github/workflows/tests.yaml'
with:
rust-version: beta
notify:
needs: tests
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Extract test results
run: |
printf '${{ toJSON(needs) }}\n'
result=$(echo '${{ toJSON(needs) }}' | jq -r .tests.result)
echo TESTS_RESULT=$result
echo "TESTS_RESULT=$result" >>"$GITHUB_ENV"
- name: Notify discord on failure
uses: n0-computer/discord-webhook-notify@v1
if: ${{ env.TESTS_RESULT == 'failure' }}
with:
severity: error
details: |
Rustc beta tests failed
See https://github.com/n0-computer/iroh/actions/workflows/beta.yaml
webhookUrl: ${{ secrets.DISCORD_N0_GITHUB_CHANNEL_WEBHOOK_URL }}

10 changes: 7 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ name: Tests
on:
workflow_call:
inputs:
rust-version:
description: 'The version of the rust compiler to run'
type: string
default: 'stable'
flaky:
description: 'Whether to also run flaky tests'
type: boolean
Expand All @@ -29,7 +33,7 @@ jobs:
fail-fast: false
matrix:
name: [ubuntu-latest, macOS-arm-latest]
rust: [nightly, stable]
rust: [ '${{ inputs.rust-version }}' ]
features: [all, none, default]
include:
- name: ubuntu-latest
Expand All @@ -52,7 +56,7 @@ jobs:
with:
ref: ${{ inputs.git-ref }}

- name: Install ${{ matrix.rust }}
- name: Install ${{ matrix.rust }} rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
Expand Down Expand Up @@ -114,7 +118,7 @@ jobs:
fail-fast: false
matrix:
name: [windows-latest]
rust: [nightly, stable]
rust: [ '${{ inputs.rust-version}}' ]
features: [all, none, default]
target:
- x86_64-pc-windows-msvc
Expand Down

0 comments on commit eab55bf

Please sign in to comment.