Repository navigation
131 lines (126 loc) · 5.62 KB
/
Copy pathinteroperability.yml
File metadata and controls
131 lines (126 loc) · 5.62 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Network controller
run-name: Network controller
on:
workflow_run:
workflows: [CI]
types: [in_progress]
permissions:
contents: read
actions: read
concurrency:
group: network-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
cancel-in-progress: false
jobs:
controller:
name: Admission and cleanup
if: ${{ github.event.workflow_run.event != 'schedule' }}
runs-on: ubuntu-24.04
timeout-minutes: 75
permissions:
contents: read
actions: read
id-token: write
attestations: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
- name: Validate CI identity
id: source
run: python3 -B -S .github/scripts/interop-broker.py metadata --root "$RUNNER_TEMP/interoperability"
- name: Upload controller context
if: ${{ steps.source.outputs.enabled == 'true' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-context-attempt-${{ github.run_attempt }}
path: ${{ runner.temp }}/interoperability/context.json
if-no-files-found: error
retention-days: 7
- name: Issue single-use enrolment keys
id: keys
continue-on-error: true
if: ${{ steps.source.outputs.enabled == 'true' }}
run: python3 -B -S .github/scripts/interop-broker.py broker --root "$RUNNER_TEMP/interoperability"
- name: Upload encrypted enrolment
if: ${{ steps.keys.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-enrolment-attempt-${{ steps.source.outputs.attempt }}
path: ${{ runner.temp }}/interoperability/enrolment.json
if-no-files-found: error
retention-days: 7
- name: Validate endpoint membership
id: membership
continue-on-error: true
if: ${{ steps.keys.outcome == 'success' }}
run: python3 -B -S .github/scripts/interop-broker.py prepare --root "$RUNNER_TEMP/interoperability"
- name: Attest admission lease
id: lease
if: ${{ steps.membership.outcome == 'success' }}
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
subject-path: ${{ runner.temp }}/interoperability/lease.json
create-storage-record: false
- name: Upload admission lease
if: ${{ always() && steps.lease.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-lease-attempt-${{ github.run_attempt }}
path: ${{ runner.temp }}/interoperability/lease.json
if-no-files-found: error
retention-days: 7
- name: Upload topology
if: ${{ steps.lease.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-topology-attempt-${{ steps.source.outputs.attempt }}
path: ${{ runner.temp }}/interoperability/topology.json
if-no-files-found: error
retention-days: 7
- name: Admit the seven endpoints
id: admission
continue-on-error: true
if: ${{ steps.lease.outcome == 'success' }}
run: python3 -B -S .github/scripts/interop-broker.py admit --root "$RUNNER_TEMP/interoperability"
- name: Upload admission
if: ${{ steps.admission.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-admission-attempt-${{ steps.source.outputs.attempt }}
path: ${{ runner.temp }}/interoperability/admission.json
if-no-files-found: error
retention-days: 7
- name: Verify directed transfer results
continue-on-error: true
if: ${{ steps.admission.outcome == 'success' }}
run: python3 -B -S .github/scripts/interop-broker.py verify --root "$RUNNER_TEMP/interoperability"
- name: Revoke access
id: revoke
continue-on-error: true
if: ${{ always() && steps.source.outputs.enabled == 'true' }}
run: python3 -B -S .github/scripts/interop-broker.py revoke --root "$RUNNER_TEMP/interoperability"
- name: Upload revocation
continue-on-error: true
if: ${{ always() && steps.lease.outcome == 'success' && steps.revoke.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-revocation-attempt-${{ steps.source.outputs.attempt }}
path: ${{ runner.temp }}/interoperability/revocation.json
if-no-files-found: error
retention-days: 7
- name: Verify revocation and remove devices
id: cleanup
if: ${{ always() && steps.source.outputs.enabled == 'true' }}
run: python3 -B -S .github/scripts/interop-broker.py finish --root "$RUNNER_TEMP/interoperability"
- name: Upload cleanup result
continue-on-error: true
if: ${{ always() && steps.cleanup.outcome == 'success' }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: interoperability-result-attempt-${{ steps.source.outputs.attempt }}
path: ${{ runner.temp }}/interoperability/result.json
if-no-files-found: error
retention-days: 7