Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Nov 13, 2024
1 parent aaa88d0 commit aee6af6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,9 @@ jobs:
# - run: nix build -L --no-link ".#bertie"
- run: true

success:
message_results:
needs: [hax, charon, eurydice, ml-kem, bertie]
runs-on: [self-hosted, linux, nix]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly

- name: commit the good flake.lock
run: |
[[ $(git diff) != "" ]] || exit 0
git config --local user.name "Prosecco"
git config --local user.email "[email protected]"
cp flake.lock good.lock
git commit -am "record the last-good flake lock"
git push
complete:
needs: [hax, charon, eurydice, ml-kem, bertie, success]
runs-on: [self-hosted, linux, nix]
if: ${{ success() || failure() }} # Will always run unless canceled
steps:
- name: checkout
Expand Down Expand Up @@ -146,3 +128,23 @@ jobs:
# { "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]
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: nightly

- name: commit the good flake.lock
run: |
[[ $(git diff) != "" ]] || exit 0
git config --local user.name "Prosecco"
git config --local user.email "[email protected]"
cp flake.lock good.lock
git commit -am "record the last-good flake lock"
# TODO: push to main if run from workflow or cron
git push
8 changes: 2 additions & 6 deletions message.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

echo "*Nightly update*"
if [[ "$(jq -r .success.result results.json)" == "success" ]]; then
if [[ "$(jq 'map(.result == "success") | all' results.json)" == "true" ]]; then
echo '✅✅✅'
else
echo '❌❌❌'
Expand All @@ -15,12 +15,8 @@ echo "run: https://github.com/inria-prosecco/circus-green/actions/runs/$RUN"
echo ""

echo "*Statuses:*"
echo aaaa
cat results.json
jq . results.json
jq .hax results.json
for project in hax charon eurydice ml-kem bertie; do
status="$(jq -r 'if .["'"$project"'"].result == "success" then "a" else "b" end' results.json)"
status="$(jq -r 'if .["'"$project"'"].result == "success" then "" else "" end' results.json)"
echo "$status $project (main)"
done
echo ""
Expand Down

0 comments on commit aee6af6

Please sign in to comment.