-
Notifications
You must be signed in to change notification settings - Fork 5
120 lines (104 loc) · 3.75 KB
/
MacOsNightly.yml
File metadata and controls
120 lines (104 loc) · 3.75 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
name: macOS Nightly Build
on:
schedule:
# Run at 3:00 AM UTC every day (5:00 AM CEST / 4:00 AM CET)
- cron: "0 3 * * *"
workflow_dispatch:
inputs:
skip_its:
description: "Skip integration tests"
required: false
default: false
type: boolean
# Only allow one instance of this workflow to run at a time
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
qa-macos:
name: "Test macOS Python ${{ matrix.python-version }}"
runs-on: macos-latest-xlarge
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.9.18", "3.10.13", "3.11.7", "3.12.1", "3.13.2"]
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Cloudflare WARP
uses: SonarSource/gh-action_setup-cloudflare-warp@v1
- name: Configure poetry
uses: ./.github/actions/config-poetry
with:
python-version: ${{ matrix.python-version }}
- name: Execute the test suite
run: poetry run pytest tests/
its-macos:
name: "macOS Integration Tests"
runs-on: macos-latest-xlarge
if: ${{ !inputs.skip_its }}
permissions:
id-token: write
contents: read
env:
SONARQUBE_VERSION: 25.3.0.104237
SKIP_DOCKER: true
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Cloudflare WARP
uses: SonarSource/gh-action_setup-cloudflare-warp@v1
- name: Cache SonarQube
uses: SonarSource/gh-action_cache@v1
id: sonarqube-cache
with:
path: sonarqube_cache/
key: sonarqube-macos-${{ env.SONARQUBE_VERSION }}
restore-keys: sonarqube-macos-
- name: Download SonarQube
if: ${{ !steps.sonarqube-cache.outputs.cache-hit }}
run: |
mkdir -p sonarqube_cache
if [ ! -f sonarqube_cache/sonarqube.zip ]; then
wget -q https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONARQUBE_VERSION.zip -O sonarqube_cache/sonarqube.zip
fi
- name: Configure poetry
uses: ./.github/actions/config-poetry
- name: Execute the integration tests
run: ./.github/scripts/run_its.sh
notify-on-failure:
name: "Notify on Failure"
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs: [qa-macos, its-macos]
if: failure() && github.event_name == 'schedule'
steps:
- name: Write failure summary
run: |
echo "## macOS Nightly Build Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The scheduled macOS nightly build has failed." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Workflow Run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
- name: Vault Secrets
id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/kv/data/slack token | SLACK_TOKEN;
- name: Send Slack notification
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
env:
SLACK_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_TOKEN }}
SLACK_CHANNEL: squad-python-notifs
SLACK_COLOR: danger
SLACK_TITLE: Build Failed
SLACK_MESSAGE: |
Workflow failed in ${{ github.repository }} 🚨
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
SLACK_USERNAME: BuildBot