.github/workflows/nightly.yaml #11
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: | |
workflow_dispatch: | |
# pull_request: # comment out to have this run on PR's | |
# runs daily at 8:00 | |
schedule: | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
- cron: '0 8 * * 1' # run weekly at 8 hour, https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
# 8 hour maybe night for you depending on your timezone. | |
# change to another hour if it's not night and you're bothered by it. | |
# You could also choose to run this once per week as this will open up an issue | |
# on failure. (and you don't want to be spammed by issues) | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install ghcup | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh | |
ghcup install cabal latest | |
ghcup set cabal latest | |
ghcup --url-source https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml install ghc latest-nightly | |
ghcup --url-source https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml set ghc latest-nightly | |
- name: cabal update | |
run: | | |
curl https://ghc.gitlab.haskell.org/head.hackage/cabal.project >> cabal.project.local | |
cabal update | |
- name: cabal build and test | |
run: | | |
cabal build all | |
cabal test all | |
notify: | |
name: Notify failed build | |
needs: build | |
if: failure() | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jayqi/failed-build-issue-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
title-template: Nightly failed | |
body-template: | | |
The nightly build failed. | |
Check the actions for details. | |
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |