Package Regression #17
This file contains hidden or 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
| name: Package Regression | |
| on: | |
| workflow_call: | |
| inputs: | |
| source-sha: | |
| description: Immutable candidate commit. | |
| required: true | |
| type: string | |
| secrets: | |
| RTK_GITHUB_TOKEN: | |
| required: false | |
| DC_GITHUB_CLIENT_ID: | |
| required: false | |
| DC_GITHUB_CLIENT_SECRET: | |
| required: false | |
| DC_GITHUB_REDIRECT_URI: | |
| required: false | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: '37 18 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| package-windows: | |
| name: regression-windows(${{ matrix.arch }}) | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, arm64] | |
| uses: ./.github/workflows/_package-windows.yml | |
| with: | |
| source-sha: ${{ inputs.source-sha || github.sha }} | |
| arch: ${{ matrix.arch }} | |
| artifact-purpose: verification | |
| enforce-installer-size: true | |
| secrets: | |
| RTK_GITHUB_TOKEN: ${{ secrets.RTK_GITHUB_TOKEN }} | |
| DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }} | |
| DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }} | |
| DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }} | |
| package-linux: | |
| name: regression-linux(${{ matrix.arch }}) | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, arm64] | |
| uses: ./.github/workflows/_package-linux.yml | |
| with: | |
| source-sha: ${{ inputs.source-sha || github.sha }} | |
| arch: ${{ matrix.arch }} | |
| artifact-purpose: verification | |
| enforce-installer-size: true | |
| secrets: | |
| RTK_GITHUB_TOKEN: ${{ secrets.RTK_GITHUB_TOKEN }} | |
| DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }} | |
| DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }} | |
| DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }} | |
| package-macos: | |
| name: regression-macos(${{ matrix.arch }}) | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, arm64] | |
| uses: ./.github/workflows/_package-macos.yml | |
| with: | |
| source-sha: ${{ inputs.source-sha || github.sha }} | |
| arch: ${{ matrix.arch }} | |
| artifact-purpose: verification | |
| enforce-installer-size: true | |
| secrets: | |
| RTK_GITHUB_TOKEN: ${{ secrets.RTK_GITHUB_TOKEN }} | |
| DC_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }} | |
| DC_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }} | |
| DC_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }} | |
| scheduled-status: | |
| name: scheduled-regression-status | |
| if: ${{ always() && github.event_name == 'schedule' }} | |
| concurrency: | |
| group: scheduled-package-regression-issue | |
| queue: max | |
| needs: | |
| - package-windows | |
| - package-linux | |
| - package-macos | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| issues: write | |
| steps: | |
| - name: Update scheduled package regression issue | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| ISSUE_TITLE: '[CI] Scheduled package regression is failing' | |
| WINDOWS_RESULT: ${{ needs.package-windows.result }} | |
| LINUX_RESULT: ${{ needs.package-linux.result }} | |
| MACOS_RESULT: ${{ needs.package-macos.result }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| set -euo pipefail | |
| open_issue_numbers="$( | |
| gh issue list \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --state open \ | |
| --search "\"${ISSUE_TITLE}\" in:title" \ | |
| --limit 100 \ | |
| --json number,title \ | |
| --jq '.[] | select(.title == env.ISSUE_TITLE) | .number' | |
| )" | |
| issue_number="${open_issue_numbers%%$'\n'*}" | |
| if [[ "${WINDOWS_RESULT}" == 'success' && | |
| "${LINUX_RESULT}" == 'success' && | |
| "${MACOS_RESULT}" == 'success' ]]; then | |
| if [[ -n "${issue_number}" ]]; then | |
| gh issue close "${issue_number}" \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --reason completed \ | |
| --comment "Recovered in [run #${GITHUB_RUN_NUMBER}](${RUN_URL})." | |
| fi | |
| exit 0 | |
| fi | |
| body_path="${RUNNER_TEMP}/package-regression-status.md" | |
| { | |
| printf 'The scheduled package regression did not complete successfully.\n\n' | |
| printf -- '- Run: [#%s](%s)\n' "${GITHUB_RUN_NUMBER}" "${RUN_URL}" | |
| printf -- '- Commit: `%s`\n' "${GITHUB_SHA}" | |
| printf -- '- Windows: `%s`\n' "${WINDOWS_RESULT}" | |
| printf -- '- Linux: `%s`\n' "${LINUX_RESULT}" | |
| printf -- '- macOS: `%s`\n' "${MACOS_RESULT}" | |
| } > "${body_path}" | |
| if [[ -n "${issue_number}" ]]; then | |
| gh issue comment "${issue_number}" \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --body-file "${body_path}" | |
| else | |
| gh issue create \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --title "${ISSUE_TITLE}" \ | |
| --body-file "${body_path}" | |
| fi |