forked from dafny-lang/dafny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Integration Tests (Reusable Workflow) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check-deep-tests: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Checkout Dafny | ||
uses: actions/checkout@v2 | ||
with: | ||
path: dafny | ||
submodules: true | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const script = require('${{ github.workspace }}/dafny/.github/workflowscheck-for-deep-tests-success.js') | ||
console.log(script({github, context, core})) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = ({github, context, core}) => { | ||
// This API doesn't support filtering by SHA, so we just | ||
// fetch the first page and scan manually. | ||
// That means if the run is fairly old it may be missed, | ||
// but that should be rare. | ||
const result = await github.rest.actions.listWorkflowRuns({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: 'deep-tests.yml', | ||
|
||
}) | ||
// These are ordered by creation time, so decide based on the first | ||
// run for this SHA we see. | ||
console.log(result) | ||
for (const run of result.data.workflow_runs) { | ||
console.log(run) | ||
if (run.sha == context.sha) { | ||
if (run.conclusion != "success") { | ||
core.setFailed(`Last run of deep tests on $context.sha did not succeed!`) | ||
} else { | ||
// The SHA is fully-tested, exit with success | ||
return | ||
} | ||
} | ||
} | ||
core.setFailed(`No run of deep tests found for $context.sha!`) | ||
} |
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