macos m1 nightly cron tests

This commit is contained in:
Anton-4 2022-08-23 20:05:45 +02:00
parent 0f3c38e2e1
commit 0be3ec13c9
No known key found for this signature in database
GPG Key ID: A13F4A6E21141925
2 changed files with 42 additions and 0 deletions

29
.github/workflows/test_nightlies.yml vendored Normal file
View File

@ -0,0 +1,29 @@
on: [pull_request]
# schedule:
# - cron: '0 15 * * *'
name: Test latest nightly release for macOS Apple Silicon
jobs:
test-and-build:
name: test nightly macos aarch64
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 90
steps:
name: fetch releases data and save to file
run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json
name: get the url of today's release for macos apple silicon
run: echo "RELEASE_URL=$(./ci/get_latest_release.sh)" >> $GITHUB_ENV
name: get the archive from the url
run: curl -OL ${{ env.RELEASE_URL }}
name: decompress the tar
run: ls | grep tar | xargs tar -xzvf
name: test roc hello world
run: ./roc examples/hello-world/main.roc

13
ci/get_latest_release_url.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# assumes roc_releases.json is present
LATEST_RELEASE_URL=`cat roc_releases.json | jq --arg today $(date +'%Y-%m-%d') '.[0] | .assets | map(.browser_download_url) | map(select(. | contains("silicon-\($today)"))) | .[0]'`
if [[ "$LATEST_RELEASE_URL" == "null" ]]
then
echo "I expected to get a url but I got null instead. Today's release may not have been uploaded?"
exit 1
else
echo $LATEST_RELEASE_URL | sed s/\"//g
fi