Skip to content

Commit

Permalink
Chore: Updated check deep tests to account for workflow refactoring, …
Browse files Browse the repository at this point in the history
…run deep tests inline with release process (#4588)

Until this PR, for the last 5 days, check-deep-tests was checking a
result that was 5 days old.
Releases are impossible because deep-tests.yml has been renamed.

This PR tweaks check-deep-tests to check the right workflow and not
attempt to check on a per-branch basis (since `nightly-build.yml` checks
the same branches no matter what branch it is launched on) - this means
development on any protected branch will be blocked by failures on any
such branch, but this is at least safe for now.

Also changed the `publish-release.yml` workflow to run the deep tests
directly instead of checking for a previous run, since this avoids the
issue above and is more efficient anyway.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>

---------

Co-authored-by: Robin Salkeld <[email protected]>
  • Loading branch information
MikaelMayer and robin-aws committed Sep 28, 2023
1 parent 3574ab8 commit b00ccc2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 30 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/check-deep-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Check Deep Tests (Reusable Workflow)

on:
workflow_call:
inputs:
sha:
type: string
branch:
type: string

jobs:
check-deep-tests:
Expand All @@ -20,9 +15,11 @@ jobs:
- uses: actions/github-script@v6
if: github.repository_owner == 'dafny-lang'
with:
# Since nightly-build.yml always targets fixed branches now, rather than being parameterized by
# branch, we can't effectively check "for a specific branch".
# That means we have to be less precise for now and block all branches if any branch fails the deep nightly tests.
script: |
const script = require('${{ github.workspace }}/dafny/.github/workflows/check-for-workflow-run.js')
console.log(script({github, context, core,
workflow_id: 'deep-tests.yml',
...('${{ inputs.sha }}' ? {sha: '${{ inputs.sha }}'} : {}),
...('${{ inputs.branch }}' ? {branch: '${{ inputs.branch }}'} : {})}))
workflow_id: 'nightly-build.yml',
branch: 'master'}))
2 changes: 0 additions & 2 deletions .github/workflows/doc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ concurrency:
jobs:
check-deep-tests:
uses: ./.github/workflows/check-deep-tests-reusable.yml
with:
branch: ${{ github.base_ref }}

doctests:
needs: check-deep-tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ env:
jobs:
check-deep-tests:
uses: ./.github/workflows/check-deep-tests-reusable.yml
with:
branch: ${{ github.base_ref }}

singletons:
needs: check-deep-tests
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ env:
dotnet-version: 6.0.x # SDK Version for building Dafny

jobs:
check-deep-tests:
uses: ./.github/workflows/check-deep-tests-reusable.yml
deep-integration-tests:
if: github.repository_owner == 'dafny-lang'
uses: ./.github/workflows/integration-tests-reusable.yml
with:
sha: ${{ github.sha }}
ref: ${{ github.ref }}
all_platforms: true
num_shards: 5

get-version:
runs-on: ubuntu-22.04
Expand All @@ -26,7 +29,7 @@ jobs:
version: ${{ steps.get-version.outputs.version-without-v }}

publish-release:
needs: [check-deep-tests, get-version]
needs: [deep-integration-tests, get-version]
uses: ./.github/workflows/publish-release-reusable.yml
with:
name: ${{ needs.get-version.outputs.version }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/refman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ concurrency:
jobs:
check-deep-tests:
uses: ./.github/workflows/check-deep-tests-reusable.yml
with:
branch: ${{ github.base_ref }}

build-refman:
needs: check-deep-tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/runtime-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ concurrency:
jobs:
check-deep-tests:
uses: ./.github/workflows/check-deep-tests-reusable.yml
with:
branch: ${{ github.base_ref }}

build:
needs: check-deep-tests
Expand Down
16 changes: 6 additions & 10 deletions docs/dev/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,21 @@
incremented since the last release, so they do not necessarily need
to be updated. However, you may want to increment them further
depending the types of changes that are in the release.

1. Run `Scripts/prepare_release.py $VER prepare --source-branch <this branch>`
(`--source-branch` is optional and defaults to 'master')
from the root of the repository. The script will check that the repository is in a good
state, create and check out a new release branch, update
`Source/Directory.Build.props` and `RELEASE_NOTES.md`, prepare a release commit,
and push it.

1. Kick off the deep test suite by navigating to
<https://github.com/dafny-lang/dafny/actions/workflows/deep-tests.yml>,
clicking the "Run workflow" dropdown, selecting the newly created branch, and
clicking the "Run workflow" button. The automation for releasing below will
check for a run of this workflow on the exact commit to release. (TODO:
Run this automatically as part of the prepare-release script.)

1. Once the the tests complete, run `Scripts/prepare_release.py $VER
1. Run `./Scripts/prepare_release.py $VER
release` from the root of the repository. The script will tag the
current commit and push it. (TODO: Merge with the two steps above.) A
current commit and push it. A
GitHub action will automatically run in reaction to the tag being
pushed, which will build the artifacts and reference manual and then
pushed, which will run the deep integration test suite,
build the artifacts and reference manual,
publish artifacts to nuget.org, and then
create a draft GitHub release. You can find and watch the progress of
this workflow at <https://github.com/dafny-lang/dafny/actions>.

Expand Down

0 comments on commit b00ccc2

Please sign in to comment.