@@ -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 :
0 commit comments