Skip to content

Commit cee07b1

Browse files
authored
bpo-45695: Test out-of-tree builds on GHA (GH-29904)
1 parent 135ecc3 commit cee07b1

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/build.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,28 @@ jobs:
179179
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
180180
- name: Configure ccache action
181181
uses: hendrikmuhs/ccache-action@v1
182-
- name: Configure CPython
183-
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
184-
- name: Build CPython
182+
- name: Setup directory envs for out-of-tree builds
183+
run: |
184+
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
185+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
186+
- name: Create directories for read-only out-of-tree builds
187+
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
188+
- name: Bind mount sources read-only
189+
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
190+
- name: Configure CPython out-of-tree
191+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
192+
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
193+
- name: Build CPython out-of-tree
194+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
185195
run: make -j4
186196
- name: Display build info
197+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
187198
run: make pythoninfo
199+
- name: Remount sources writable for tests
200+
# some tests write to srcdir, lack of pyc files slows down testing
201+
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
188202
- name: Tests
203+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
189204
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
190205

191206
build_ubuntu_ssltests:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Out-of-tree builds with a read-only source directory are now tested by CI.

0 commit comments

Comments
 (0)