Merge branch 'js/ci-ghwf-dedup-tests'

GitHub Actions automated test improvement to skip tests on a tree
identical to what has already been tested.

* js/ci-ghwf-dedup-tests:
  ci: make the "skip-if-redundant" check more defensive
  ci: work around old records of GitHub runs
maint
Junio C Hamano 2020-10-30 13:04:24 -07:00
commit 876511ef61
1 changed files with 31 additions and 27 deletions

View File

@ -41,6 +41,7 @@ jobs:
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
try {
// Figure out workflow ID, commit and tree // Figure out workflow ID, commit and tree
const { data: run } = await github.actions.getWorkflowRun({ const { data: run } = await github.actions.getWorkflowRun({
owner: context.repo.owner, owner: context.repo.owner,
@ -65,12 +66,15 @@ jobs:
core.setOutput('enabled', ' but skip'); core.setOutput('enabled', ' but skip');
break; break;
} }
if (tree_id === run.head_commit.tree_id) { if (run.head_commit && tree_id === run.head_commit.tree_id) {
core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`); core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
core.setOutput('enabled', ' but skip'); core.setOutput('enabled', ' but skip');
break; break;
} }
} }
} catch (e) {
core.warning(e);
}


windows-build: windows-build:
needs: ci-config needs: ci-config