|
| 1 | +name: macOS Nightly Build |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run at 3:00 AM UTC every day (5:00 AM CEST / 4:00 AM CET) |
| 6 | + - cron: "0 3 * * *" |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + skip_its: |
| 10 | + description: "Skip integration tests" |
| 11 | + required: false |
| 12 | + default: false |
| 13 | + type: boolean |
| 14 | + |
| 15 | +# Only allow one instance of this workflow to run at a time |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + qa-macos: |
| 22 | + name: "Test macOS Python ${{ matrix.python-version }}" |
| 23 | + runs-on: macos-latest-xlarge |
| 24 | + permissions: |
| 25 | + id-token: write |
| 26 | + contents: read |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + python-version: ["3.9.18", "3.10.13", "3.11.7", "3.12.1", "3.13.2"] |
| 31 | + steps: |
| 32 | + - name: Checkout repository |
| 33 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 34 | + |
| 35 | + - name: Setup Cloudflare WARP |
| 36 | + uses: SonarSource/gh-action_setup-cloudflare-warp@v1 |
| 37 | + |
| 38 | + - name: Configure poetry |
| 39 | + uses: ./.github/actions/config-poetry |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + |
| 43 | + - name: Execute the test suite |
| 44 | + run: poetry run pytest tests/ |
| 45 | + |
| 46 | + its-macos: |
| 47 | + name: "macOS Integration Tests" |
| 48 | + runs-on: macos-latest-xlarge |
| 49 | + if: ${{ !inputs.skip_its }} |
| 50 | + permissions: |
| 51 | + id-token: write |
| 52 | + contents: read |
| 53 | + env: |
| 54 | + SONARQUBE_VERSION: 25.3.0.104237 |
| 55 | + SKIP_DOCKER: true |
| 56 | + steps: |
| 57 | + - name: Checkout repository |
| 58 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 59 | + |
| 60 | + - name: Setup Cloudflare WARP |
| 61 | + uses: SonarSource/gh-action_setup-cloudflare-warp@v1 |
| 62 | + |
| 63 | + - name: Cache SonarQube |
| 64 | + uses: SonarSource/gh-action_cache@v1 |
| 65 | + id: sonarqube-cache |
| 66 | + with: |
| 67 | + path: sonarqube_cache/ |
| 68 | + key: sonarqube-macos-${{ env.SONARQUBE_VERSION }} |
| 69 | + restore-keys: sonarqube-macos- |
| 70 | + |
| 71 | + - name: Download SonarQube |
| 72 | + if: ${{ !steps.sonarqube-cache.outputs.cache-hit }} |
| 73 | + run: | |
| 74 | + mkdir -p sonarqube_cache |
| 75 | + if [ ! -f sonarqube_cache/sonarqube.zip ]; then |
| 76 | + wget -q https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONARQUBE_VERSION.zip -O sonarqube_cache/sonarqube.zip |
| 77 | + fi |
| 78 | +
|
| 79 | + - name: Configure poetry |
| 80 | + uses: ./.github/actions/config-poetry |
| 81 | + |
| 82 | + - name: Execute the integration tests |
| 83 | + run: ./.github/scripts/run_its.sh |
| 84 | + |
| 85 | + notify-on-failure: |
| 86 | + name: "Notify on Failure" |
| 87 | + runs-on: ubuntu-latest |
| 88 | + permissions: |
| 89 | + id-token: write |
| 90 | + contents: read |
| 91 | + needs: [qa-macos, its-macos] |
| 92 | + if: failure() && github.event_name == 'schedule' |
| 93 | + steps: |
| 94 | + - name: Write failure summary |
| 95 | + run: | |
| 96 | + echo "## macOS Nightly Build Failed" >> $GITHUB_STEP_SUMMARY |
| 97 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 98 | + echo "The scheduled macOS nightly build has failed." >> $GITHUB_STEP_SUMMARY |
| 99 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 100 | + echo "**Workflow Run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY |
| 101 | +
|
| 102 | + - name: Vault Secrets |
| 103 | + id: secrets |
| 104 | + uses: SonarSource/vault-action-wrapper@v3 |
| 105 | + with: |
| 106 | + secrets: | |
| 107 | + development/kv/data/slack token | SLACK_TOKEN; |
| 108 | +
|
| 109 | + - name: Send Slack notification |
| 110 | + uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3 |
| 111 | + env: |
| 112 | + SLACK_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_TOKEN }} |
| 113 | + SLACK_CHANNEL: squad-python-notifs |
| 114 | + SLACK_COLOR: danger |
| 115 | + SLACK_TITLE: Build Failed |
| 116 | + SLACK_MESSAGE: | |
| 117 | + Workflow failed in ${{ github.repository }} 🚨 |
| 118 | + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 119 | + SLACK_USERNAME: BuildBot |
| 120 | + |
0 commit comments