-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
123 additions
and
792 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,15 @@ on: | |
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
push: | ||
|
||
# Cancel previous versions of this job that are still running. | ||
concurrency: | ||
group: nightly | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
nightly: | ||
update-flake: | ||
runs-on: [self-hosted, linux, nix] | ||
steps: | ||
- name: checkout | ||
|
@@ -13,42 +19,127 @@ jobs: | |
- name: update | ||
run: ./update.sh | ||
|
||
# Commit the update onto a new branch | ||
- name: commit | ||
run: | | ||
[[ $(git diff) != "" ]] || exit 0 | ||
git config --local user.name "Prosecco" | ||
git config --local user.email "[email protected]" | ||
git checkout -b nightly | ||
git commit -am "nightly update" | ||
git push origin --force nightly: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/orgs/community/discussions/26640 | ||
# - 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: nix build -L --no-link ".#hax" | ||
- run: true | ||
|
||
charon: | ||
needs: update-flake | ||
runs-on: [self-hosted, linux, nix] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: nightly | ||
# - run: nix build -L --no-link ".#charon" | ||
- run: false | ||
|
||
eurydice: | ||
needs: update-flake | ||
runs-on: [self-hosted, linux, nix] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: nightly | ||
# - run: nix build -L --no-link ".#eurydice" | ||
- run: true | ||
|
||
- name: push | ||
uses: ad-m/github-push-action@master | ||
ml-kem: | ||
needs: update-flake | ||
runs-on: [self-hosted, linux, nix] | ||
steps: | ||
- name: checkout | ||
with: | ||
branch: main | ||
ref: nightly | ||
uses: actions/checkout@v4 | ||
# - run: nix build -L --no-link ".#ml-kem" | ||
- run: true | ||
|
||
bertie: | ||
needs: update-flake | ||
runs-on: [self-hosted, linux, nix] | ||
steps: | ||
- name: checkout | ||
with: | ||
ref: nightly | ||
uses: actions/checkout@v4 | ||
# - run: nix build -L --no-link ".#bertie" | ||
- run: true | ||
|
||
message_results: | ||
needs: [hax, charon, 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 zulip message | ||
env: | ||
RUN: ${{ github.run_id }} | ||
RESULTS: ${{ toJSON(needs) }} | ||
run: | | ||
echo "$RESULTS" > results.json | ||
nix shell nixpkgs#jq --command ./message.sh | tee message.txt | ||
{ | ||
echo 'MSG<<EOF' | ||
echo "*Nightly update*" | ||
nix shell nixpkgs#jq --command ./message.sh | ||
cat message.txt | ||
echo EOF | ||
} >> "$GITHUB_ENV" | ||
env: | ||
RUN: ${{ github.run_id }} | ||
- 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() }} | ||
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 }} | ||
|
||
success: | ||
needs: [hax, charon, eurydice, ml-kem, bertie, message_results] | ||
runs-on: [self-hosted, linux, nix] | ||
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: nightly | ||
|
||
- name: push to main | ||
run: git push origin HEAD:main | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.