.github/workflows/nightly.yml #282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
fstar: | |
description: "Fstar" | |
type: "string" | |
default: "master" | |
karamel: | |
description: "KaRaMeL" | |
type: "string" | |
default: "master" | |
hax: | |
description: "Hax" | |
type: "string" | |
default: "main" | |
charon: | |
description: "Charon" | |
type: "string" | |
default: "main" | |
eurydice: | |
description: "Eurydice" | |
type: "string" | |
default: "main" | |
aeneas: | |
description: "Aeneas" | |
type: "string" | |
default: "main" | |
libcrux: | |
description: "Libcrux" | |
type: "string" | |
default: "main" | |
bertie: | |
description: "Bertie" | |
type: "string" | |
default: "main" | |
push: | |
branches-ignore: | |
- main | |
# Cancel previous versions of this job that are still running. | |
concurrency: | |
group: nightly | |
cancel-in-progress: true | |
jobs: | |
update-flake: | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: update | |
env: | |
HAX_BRANCH: ${{ inputs.hax }} | |
CHARON_BRANCH: ${{ inputs.charon }} | |
AENEAS_BRANCH: ${{ inputs.aeneas }} | |
EURYDICE_BRANCH: ${{ inputs.eurydice }} | |
LIBCRUX_BRANCH: ${{ inputs.libcrux }} | |
BERTIE_BRANCH: ${{ inputs.bertie }} | |
run: ./update.sh | |
# Commit the update onto a new branch | |
- name: commit | |
run: | | |
git config --local user.name "Prosecco" | |
git config --local user.email "[email protected]" | |
[[ $(git diff) != "" ]] && git commit -am "nightly update" | |
git push origin --force HEAD:nightly | |
# This would be nicer as a matrix, but that hits limits of what github actions can currenctly express. See e.g.: | |
# - https://github.com/orgs/community/discussions/17245 | |
# - https://github.com/actions/runner/pull/2477 | |
hax: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly | |
- run: ./check.sh hax | |
charon: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly | |
- run: ./check.sh charon | |
aeneas: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly | |
- run: ./check.sh aeneas | |
eurydice: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly | |
- run: ./check.sh eurydice | |
ml-kem: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
with: | |
ref: nightly | |
uses: actions/checkout@v4 | |
- run: ./check.sh ml-kem | |
bertie: | |
needs: update-flake | |
runs-on: [self-hosted, linux, nix] | |
steps: | |
- name: checkout | |
with: | |
ref: nightly | |
uses: actions/checkout@v4 | |
- run: ./check.sh bertie | |
process_results: | |
needs: [hax, charon, aeneas, eurydice, ml-kem, bertie] | |
runs-on: [self-hosted, linux, nix] | |
if: ${{ success() || failure() }} # Will always run unless canceled | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: nightly | |
fetch-depth: 0 # deep clone in order to get access to other commits | |
- name: generate results message | |
env: | |
RUN: ${{ github.run_id }} | |
RESULTS: ${{ toJSON(needs) }} | |
run: | | |
echo "$RESULTS" > results.json | |
nix shell nixpkgs#jq --command ./message.sh | tee "$GITHUB_ENV" | |
- name: push to main | |
if: ${{ env.SUCCESS == '1' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} | |
run: git push origin HEAD:main | |
- name: send zulip info message | |
uses: slackapi/[email protected] | |
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
with: | |
payload: | | |
{ "text": ${{ toJSON(env.MSG) }} } | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }} | |
- name: send zulip error message | |
if: ${{ failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }} | |
uses: slackapi/[email protected] | |
with: | |
payload: | | |
{ "text": "Unexpected Error: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" } | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ZULIP_WEBHOOK_URL }} |