From b00ccc289c487fff96a8c6d9bfb43aafc970dd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Mayer?= Date: Thu, 28 Sep 2023 12:34:59 -0500 Subject: [PATCH] Chore: Updated check deep tests to account for workflow refactoring, 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. 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). --------- Co-authored-by: Robin Salkeld --- .github/workflows/check-deep-tests-reusable.yml | 13 +++++-------- .github/workflows/doc-tests.yml | 2 -- .github/workflows/msbuild.yml | 2 -- .github/workflows/publish-release.yml | 11 +++++++---- .github/workflows/refman.yml | 2 -- .github/workflows/runtime-tests.yml | 2 -- docs/dev/RELEASE.md | 16 ++++++---------- 7 files changed, 18 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check-deep-tests-reusable.yml b/.github/workflows/check-deep-tests-reusable.yml index c2c6e23dcd2..e442de4bee4 100644 --- a/.github/workflows/check-deep-tests-reusable.yml +++ b/.github/workflows/check-deep-tests-reusable.yml @@ -2,11 +2,6 @@ name: Check Deep Tests (Reusable Workflow) on: workflow_call: - inputs: - sha: - type: string - branch: - type: string jobs: check-deep-tests: @@ -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'})) diff --git a/.github/workflows/doc-tests.yml b/.github/workflows/doc-tests.yml index 3671d2bc42d..468cf5f6f65 100644 --- a/.github/workflows/doc-tests.yml +++ b/.github/workflows/doc-tests.yml @@ -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 diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 90497c0c9a3..d629c75f3f7 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -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 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index bf4126bf4c8..7600affd731 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/refman.yml b/.github/workflows/refman.yml index 21147d1d37a..584418be832 100644 --- a/.github/workflows/refman.yml +++ b/.github/workflows/refman.yml @@ -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 diff --git a/.github/workflows/runtime-tests.yml b/.github/workflows/runtime-tests.yml index 330e6ed2ef5..4174d9d5b73 100644 --- a/.github/workflows/runtime-tests.yml +++ b/.github/workflows/runtime-tests.yml @@ -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 diff --git a/docs/dev/RELEASE.md b/docs/dev/RELEASE.md index e8cf95aaef5..136817118ce 100644 --- a/docs/dev/RELEASE.md +++ b/docs/dev/RELEASE.md @@ -13,6 +13,7 @@ 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 ` (`--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 @@ -20,18 +21,13 @@ `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 - , - 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 .