merge lock file #317
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
name: merge lock file | |
on: | |
schedule: | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
jobs: | |
merge-flake-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: checkout to update-flake-lock | |
run: | | |
git checkout origin/update-flake-lock | |
- name: check build status | |
run: | | |
PROJECT=hacl-nix | |
BRANCH=update-flake-lock | |
STATUS_SUCCEEDED=0 # from https://github.com/NixOS/hydra/blob/cf9f38e43fd81f9298e3f2ff50c8a6ee0acc3af0/hydra-api.yaml#L927-L941 | |
baseUrl="https://everest-ci.paris.inria.fr" | |
latestFinishedEval=$(curl -sLH 'Content-Type: application/json' "$baseUrl/jobset/$PROJECT/branch-$BRANCH/latest-eval") | |
rev=$(echo "$latestFinishedEval" | jq -r '.flake | split("/") | last') | |
id=$(echo "$latestFinishedEval" | jq -r '.id') | |
[[ "$rev" == "$(git rev-parse HEAD)" ]] || { | |
echo "The latest evaluation on the CI doesn't correspond to the latest commit." | |
exit 1 | |
} | |
buildUrl="$baseUrl/eval/$id/job/hacl.x86_64-linux" | |
buildInfo=$(curl -sLH 'Content-Type: application/json' "$buildUrl") | |
# Check wether the build was built correctly | |
[[ "$(echo "$buildInfo" | jq -r '.buildstatus')" == "$STATUS_SUCCEEDED" ]] || { | |
echo "The latest evaluation wasn't successful." | |
exit 2 | |
} | |
- name: push | |
uses: ad-m/github-push-action@master | |
with: | |
branch: ${{ github.ref }} |