|
| 1 | +name: Directed transfers |
| 2 | +description: Native SSH and daemon transfers between seven endpoints |
| 3 | +inputs: |
| 4 | + platform: |
| 5 | + required: true |
| 6 | + description: Native endpoint |
| 7 | + guest: |
| 8 | + default: 'false' |
| 9 | + description: Use the existing local VM SSH connection |
| 10 | +outputs: |
| 11 | + blocked: |
| 12 | + description: A shared phase could not run |
| 13 | + value: ${{ steps.outcome.outputs.blocked }} |
| 14 | +runs: |
| 15 | + using: composite |
| 16 | + steps: |
| 17 | + - name: Install Tailscale |
| 18 | + shell: bash |
| 19 | + env: |
| 20 | + GH_TOKEN: ${{ github.token }} |
| 21 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 22 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 23 | + run: python3 -B -S .github/scripts/interop-host.py install "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 24 | + - name: Generate enrolment recipient |
| 25 | + shell: bash |
| 26 | + env: |
| 27 | + GH_TOKEN: ${{ github.token }} |
| 28 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 29 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 30 | + run: python3 -B -S .github/scripts/interop-host.py recipient "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 31 | + - name: Upload recipient |
| 32 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 33 | + with: |
| 34 | + name: interoperability-public-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 35 | + path: ${{ runner.temp }}/interoperability/public-key.json |
| 36 | + if-no-files-found: error |
| 37 | + retention-days: 7 |
| 38 | + - name: Join quarantine |
| 39 | + shell: bash |
| 40 | + env: |
| 41 | + GH_TOKEN: ${{ github.token }} |
| 42 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 43 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 44 | + run: python3 -B -S .github/scripts/interop-host.py connect "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 45 | + - name: Start native fixture services |
| 46 | + if: env.INTEROP_BLOCKED != 'true' |
| 47 | + shell: bash |
| 48 | + env: |
| 49 | + GH_TOKEN: ${{ github.token }} |
| 50 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 51 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 52 | + run: python3 -B -S .github/scripts/interop-host.py prepare "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 53 | + - name: Upload endpoint identity |
| 54 | + if: env.INTEROP_BLOCKED != 'true' |
| 55 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 56 | + with: |
| 57 | + name: interoperability-ready-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 58 | + path: ${{ runner.temp }}/interoperability/ready.json |
| 59 | + if-no-files-found: error |
| 60 | + retention-days: 7 |
| 61 | + - name: Check quarantine |
| 62 | + if: env.INTEROP_BLOCKED != 'true' |
| 63 | + shell: bash |
| 64 | + env: |
| 65 | + GH_TOKEN: ${{ github.token }} |
| 66 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 67 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 68 | + run: python3 -B -S .github/scripts/interop-host.py quarantine "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 69 | + - name: Upload quarantine result |
| 70 | + if: env.INTEROP_BLOCKED != 'true' |
| 71 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 72 | + with: |
| 73 | + name: interoperability-quarantine-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 74 | + path: ${{ runner.temp }}/interoperability/quarantine.json |
| 75 | + if-no-files-found: error |
| 76 | + retention-days: 7 |
| 77 | + - name: Check admission |
| 78 | + if: env.INTEROP_BLOCKED != 'true' |
| 79 | + shell: bash |
| 80 | + env: |
| 81 | + GH_TOKEN: ${{ github.token }} |
| 82 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 83 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 84 | + run: python3 -B -S .github/scripts/interop-host.py admit "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 85 | + - name: Upload endpoint admission |
| 86 | + if: env.INTEROP_BLOCKED != 'true' |
| 87 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 88 | + with: |
| 89 | + name: interoperability-admitted-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 90 | + path: ${{ runner.temp }}/interoperability/admitted.json |
| 91 | + if-no-files-found: error |
| 92 | + retention-days: 7 |
| 93 | + - name: Initial transfers |
| 94 | + id: transfer1 |
| 95 | + if: env.INTEROP_BLOCKED != 'true' |
| 96 | + shell: bash |
| 97 | + env: |
| 98 | + GH_TOKEN: ${{ github.token }} |
| 99 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 100 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 101 | + run: python3 -B -S .github/scripts/interop-host.py transfer1 "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 102 | + - name: Upload initial transfer completion |
| 103 | + id: transfer1_upload |
| 104 | + if: ${{ always() && !cancelled() && env.INTEROP_BLOCKED != 'true' && (steps.transfer1.outcome == 'success' || steps.transfer1.outcome == 'failure') }} |
| 105 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 106 | + with: |
| 107 | + name: interoperability-transfer1-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 108 | + path: ${{ runner.temp }}/interoperability/transfer1.json |
| 109 | + if-no-files-found: error |
| 110 | + retention-days: 7 |
| 111 | + - name: Complete initial transfer phase |
| 112 | + if: ${{ always() && !cancelled() && steps.transfer1_upload.outcome == 'success' }} |
| 113 | + shell: bash |
| 114 | + env: |
| 115 | + GH_TOKEN: ${{ github.token }} |
| 116 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 117 | + run: python3 -B -S .github/scripts/interop-host.py wait1 "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 118 | + - name: Verify initial data and update sources |
| 119 | + if: env.INTEROP_BLOCKED != 'true' |
| 120 | + shell: bash |
| 121 | + env: |
| 122 | + GH_TOKEN: ${{ github.token }} |
| 123 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 124 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 125 | + run: python3 -B -S .github/scripts/interop-host.py next "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 126 | + - name: Upload update readiness |
| 127 | + if: env.INTEROP_BLOCKED != 'true' |
| 128 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 129 | + with: |
| 130 | + name: interoperability-next-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 131 | + path: ${{ runner.temp }}/interoperability/next.json |
| 132 | + if-no-files-found: error |
| 133 | + retention-days: 7 |
| 134 | + - name: Checksum updates and deletion |
| 135 | + id: transfer2 |
| 136 | + if: env.INTEROP_BLOCKED != 'true' |
| 137 | + shell: bash |
| 138 | + env: |
| 139 | + GH_TOKEN: ${{ github.token }} |
| 140 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 141 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 142 | + run: python3 -B -S .github/scripts/interop-host.py transfer2 "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 143 | + - name: Upload update completion |
| 144 | + id: transfer2_upload |
| 145 | + if: ${{ always() && !cancelled() && env.INTEROP_BLOCKED != 'true' && (steps.transfer2.outcome == 'success' || steps.transfer2.outcome == 'failure') }} |
| 146 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 147 | + with: |
| 148 | + name: interoperability-transfer2-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 149 | + path: ${{ runner.temp }}/interoperability/transfer2.json |
| 150 | + if-no-files-found: error |
| 151 | + retention-days: 7 |
| 152 | + - name: Complete updated transfer phase |
| 153 | + if: ${{ always() && !cancelled() && steps.transfer2_upload.outcome == 'success' }} |
| 154 | + shell: bash |
| 155 | + env: |
| 156 | + GH_TOKEN: ${{ github.token }} |
| 157 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 158 | + run: python3 -B -S .github/scripts/interop-host.py wait2 "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 159 | + - name: Verify updated native data |
| 160 | + if: env.INTEROP_BLOCKED != 'true' |
| 161 | + shell: bash |
| 162 | + env: |
| 163 | + GH_TOKEN: ${{ github.token }} |
| 164 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 165 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 166 | + run: python3 -B -S .github/scripts/interop-host.py verify "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 167 | + - name: Upload transfer result |
| 168 | + if: env.INTEROP_BLOCKED != 'true' |
| 169 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 170 | + with: |
| 171 | + name: interoperability-result-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 172 | + path: ${{ runner.temp }}/interoperability/result.json |
| 173 | + if-no-files-found: error |
| 174 | + retention-days: 7 |
| 175 | + - name: Check revocation |
| 176 | + if: env.INTEROP_BLOCKED != 'true' |
| 177 | + shell: bash |
| 178 | + env: |
| 179 | + GH_TOKEN: ${{ github.token }} |
| 180 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 181 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 182 | + run: python3 -B -S .github/scripts/interop-host.py revoked "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 183 | + - name: Upload revocation result |
| 184 | + if: env.INTEROP_BLOCKED != 'true' |
| 185 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 186 | + with: |
| 187 | + name: interoperability-revoked-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 188 | + path: ${{ runner.temp }}/interoperability/revoked.json |
| 189 | + if-no-files-found: error |
| 190 | + retention-days: 7 |
| 191 | + - name: Upload blocked phase |
| 192 | + if: ${{ always() && env.INTEROP_BLOCKED == 'true' }} |
| 193 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 194 | + with: |
| 195 | + name: interoperability-blocked-${{ inputs.platform }}-attempt-${{ github.run_attempt }} |
| 196 | + path: ${{ runner.temp }}/interoperability/blocked.json |
| 197 | + if-no-files-found: error |
| 198 | + retention-days: 7 |
| 199 | + - name: Stop fixture services and leave the network |
| 200 | + if: always() |
| 201 | + shell: bash |
| 202 | + env: |
| 203 | + GH_TOKEN: ${{ github.token }} |
| 204 | + INTEROP_PLATFORM: ${{ inputs.platform }} |
| 205 | + INTEROP_GUEST: ${{ inputs.guest }} |
| 206 | + run: python3 -B -S .github/scripts/interop-host.py stop "$INTEROP_PLATFORM" --root "$RUNNER_TEMP/interoperability" |
| 207 | + - name: Record endpoint outcome |
| 208 | + id: outcome |
| 209 | + if: always() |
| 210 | + shell: bash |
| 211 | + run: | |
| 212 | + python3 -B -S - <<'PY' |
| 213 | + import os |
| 214 | + with open(os.environ['GITHUB_OUTPUT'], 'a') as output: |
| 215 | + output.write('blocked=' + os.environ.get('INTEROP_BLOCKED', 'false') + '\n') |
| 216 | + PY |
0 commit comments