forked from zcash/zcash
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.92 KB
/
ci-status.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CI status
on:
workflow_run:
workflows: [CI]
types: [completed]
permissions:
contents: read
statuses: write
jobs:
required-pass:
name: Check required-pass steps
runs-on: ubuntu-latest
steps:
- name: Fetch statuses for required-pass steps
id: fetch-statuses
uses: actions/github-script@v7
with:
script: |
const res = await github.paginate("GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", {
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
per_page: 100
})
const statuses = res.map((status) => ({ name: status.name, conclusion: status.conclusion }))
return statuses
- name: Determine whether all required-pass steps succeeded
run: |
echo '${{ steps.fetch-statuses.outputs.result }}' | jq -e '[ .[] | select(.name | test("(Build tier [12])|(Boost.Test tier 1)|(GoogleTest tier 1)|(Rust test tier 1)|(secp256k1 tier 1)|(univalue tier 1)|(util-test tier 1)|(no-dot-so tier 1)|(sec-hard tier 1)|(RPC tests tier 1 .* shard-)")) | .conclusion == "success" ] | all'
- name: Submit required-passed status
if: ${{ !cancelled() }}
uses: actions/github-script@v7
env:
JOB_STATUS: ${{ job.status }}
with:
script: |
const {JOB_STATUS} = process.env
await github.request("POST /repos/{owner}/{repo}/statuses/{sha}", {
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.workflow_run.head_sha,
state: `${JOB_STATUS}`,
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.payload.workflow_run.id}`,
description: "Finished",
context: "CI / Required status checks"
})