Nightly test and release workflow #924
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
# This workflow includes more expensive tests than what is run on every PR, that are unlikely to break on most changes. | |
# It also publishes a nightly release. | |
# | |
# The if at the beginning of each job terminates the workflow immediately on any repo (like a fork) that is not the main | |
# dafny-lang/dafny repo. This stops such forks from running this workflow and failing (for lack of a secret) the attempt to | |
# publish a nightly build themselves. | |
name: Nightly test and release workflow | |
on: | |
schedule: | |
# Chosen to be hopefully outside of business hours for most contributors' | |
# time zones, and not on the hour to avoid heavy scheduled-job times: | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
- cron: "30 14 * * *" | |
workflow_dispatch: | |
jobs: | |
deep-integration-tests: | |
if: github.repository_owner == 'dafny-lang' | |
uses: ./.github/workflows/integration-tests-reusable.yml | |
with: | |
all_platforms: true | |
num_shards: 5 | |
determine-vars: | |
if: github.repository_owner == 'dafny-lang' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Dafny | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.sha }} | |
submodules: recursive | |
- name: Get short sha | |
run: echo "sha_short=`git rev-parse --short HEAD`" >> $GITHUB_ENV | |
- name: Get current date | |
run: echo "date=`date +'%Y-%m-%d'`" >> $GITHUB_ENV | |
outputs: | |
name: nightly-${{ env.date }}-${{ env.sha_short }} | |
publish-release: | |
uses: ./.github/workflows/publish-release-reusable.yml | |
needs: [deep-integration-tests, determine-vars] | |
with: | |
name: ${{ needs.determine-vars.outputs.name }} | |
sha: ${{ github.sha }} | |
tag_name: nightly | |
release_nuget: true | |
draft: false | |
release_notes: "This is an automatically published nightly release. This release may not be as stable as versioned releases and does not contain release notes." | |
prerelease: true | |
secrets: | |
nuget_api_key: ${{ secrets.NUGET_API_KEY }} |