Skip to content

Commit 65be772

Browse files
committed
[CI] Prepare Mac CI for homebrew-based VMs.
The homebrew VMs use a virtualenv for Python. Since it's not added to the path by default, we test if an environment has been set up and enter it before any build and test step. Furthermore, the paths to the ca certificates differ between the VMs and the physical Macs, so the setup of the environment variable will test multiple paths now.
1 parent 63cbd19 commit 65be772

File tree

1 file changed

+57
-42
lines changed

1 file changed

+57
-42
lines changed

.github/workflows/root-ci.yml

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ jobs:
101101
run:
102102
shell: bash -leo pipefail {0} # Use login shell, so profile scripts get sourced
103103

104+
env:
105+
VIRTUAL_ENV_DIR: ${{ github.workspace }}/ROOT_CI_VENV
106+
104107
strategy:
105108
fail-fast: false
106109
matrix:
107-
# Specify platform + arch + (optional) build option overrides
108-
#
109-
# Common configs: {Release,Debug,RelWithDebInfo)
110+
# Specify platform + optional build option overrides
110111
# Build options: https://root.cern/install/build_from_source/#all-build-options
111112
include:
112113
- platform: mac14
@@ -121,10 +122,8 @@ jobs:
121122
is_special: true
122123
arch: ARM64
123124

124-
runs-on: # Using '[self-hosted, ..., ...]' does not work for some reason :)
125+
runs-on:
125126
- self-hosted
126-
- macOS
127-
- ${{ matrix.arch }}
128127
- ${{ matrix.platform }}
129128

130129
name: |
@@ -141,8 +140,13 @@ jobs:
141140
with:
142141
build-directory: /Users/sftnight/ROOT-CI/src/
143142

144-
- name: Set up curl CA bundle for Davix to work with https
145-
run: 'echo SSL_CERT_FILE=/opt/local/share/curl/curl-ca-bundle.crt >> $GITHUB_ENV'
143+
- name: Export SSL certificate files for Davix
144+
run: |
145+
for cert in /opt/homebrew/opt/ca-certificates/share/ca-certificates/cacert.pem /opt/local/share/curl/curl-ca-bundle.crt; do
146+
if [ -f ${cert} ]; then
147+
echo "SSL_CERT_FILE=${cert}" >> $GITHUB_ENV
148+
fi
149+
done
146150
147151
- name: Pull Request Build
148152
if: github.event_name == 'pull_request'
@@ -151,52 +155,63 @@ jobs:
151155
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') && !matrix.platform == 'mac15' && !matrix.platform == 'mac26'}}
152156
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
153157
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
154-
run: ".github/workflows/root-ci-config/build_root.py
155-
--buildtype RelWithDebInfo
156-
--incremental $INCREMENTAL
157-
--base_ref ${{ github.base_ref }}
158-
--sha ${{ github.sha }}
159-
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }}
160-
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
161-
--head_sha ${{ github.event.pull_request.head.sha }}
162-
--repository ${{ github.server_url }}/${{ github.repository }}
163-
--platform ${{ matrix.platform }}
164-
--overrides ${GLOBAL_OVERRIDES} ${OVERRIDES}"
158+
run: |
159+
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
160+
echo "Python is now $(which python3) $(python3 --version)"
161+
src/.github/workflows/root-ci-config/build_root.py \
162+
--buildtype RelWithDebInfo \
163+
--incremental $INCREMENTAL \
164+
--base_ref ${{ github.base_ref }} \
165+
--sha ${{ github.sha }} \
166+
--pull_repository ${{ github.event.pull_request.head.repo.clone_url }} \
167+
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }} \
168+
--head_sha ${{ github.event.pull_request.head.sha }} \
169+
--repository ${{ github.server_url }}/${{ github.repository }} \
170+
--platform ${{ matrix.platform }} \
171+
--overrides ${GLOBAL_OVERRIDES} ${OVERRIDES}
165172
166173
- name: Workflow dispatch
167174
if: ${{ github.event_name == 'workflow_dispatch' && !matrix.is_special }}
168-
run: ".github/workflows/root-ci-config/build_root.py
169-
--buildtype ${{ inputs.buildtype }}
170-
--platform ${{ matrix.platform }}
171-
--incremental ${{ inputs.incremental }}
172-
--base_ref ${{ inputs.base_ref }}
173-
--head_ref ${{ inputs.head_ref }}
174-
--binaries ${{ inputs.binaries }}
175-
--repository ${{ github.server_url }}/${{ github.repository }}"
175+
run: |
176+
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
177+
echo "Python is now $(which python3) $(python3 --version)"
178+
src/.github/workflows/root-ci-config/build_root.py \
179+
--buildtype ${{ inputs.buildtype }} \
180+
--platform ${{ matrix.platform }} \
181+
--incremental ${{ inputs.incremental }}\
182+
--base_ref ${{ inputs.base_ref }} \
183+
--head_ref ${{ inputs.head_ref }} \
184+
--binaries ${{ inputs.binaries }} \
185+
--repository ${{ github.server_url }}/${{ github.repository }}
176186
177187
- name: Nightly build
178188
if: github.event_name == 'schedule'
179-
run: ".github/workflows/root-ci-config/build_root.py
180-
--buildtype Release
181-
--platform ${{ matrix.platform }}
182-
--incremental false
183-
--binaries true
184-
--base_ref ${{ inputs.ref_name }}
185-
--repository ${{ github.server_url }}/${{ github.repository }}"
189+
run: |
190+
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
191+
echo "Python is now $(which python3) $(python3 --version)"
192+
src/.github/workflows/root-ci-config/build_root.py \
193+
--buildtype Release \
194+
--platform ${{ matrix.platform }} \
195+
--incremental false \
196+
--binaries true \
197+
--base_ref ${{ inputs.ref_name }} \
198+
--repository ${{ github.server_url }}/${{ github.repository }}
186199
187200
- name: Update build cache after push to release branch
188201
if: github.event_name == 'push'
189202
env:
190203
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
191-
run: ".github/workflows/root-ci-config/build_root.py
192-
--buildtype RelWithDebInfo
193-
--platform ${{ matrix.platform }}
194-
--incremental false
195-
--base_ref ${{ github.ref_name }}
196-
--binaries ${{ startsWith(github.ref, 'refs/tags/') }}
197-
--repository ${{ github.server_url }}/${{ github.repository }}
204+
run: |
205+
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
206+
echo "Python is now $(which python3) $(python3 --version)"
207+
src/.github/workflows/root-ci-config/build_root.py \
208+
--buildtype RelWithDebInfo \
209+
--platform ${{ matrix.platform }} \
210+
--incremental false \
211+
--base_ref ${{ github.ref_name }} \
212+
--binaries ${{ startsWith(github.ref, 'refs/tags/') }} \
213+
--repository ${{ github.server_url }}/${{ github.repository }} \
198214
--overrides ${GLOBAL_OVERRIDES} ${OVERRIDES}
199-
"
200215
201216
- name: Upload test results
202217
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)