@@ -33,11 +33,11 @@ jobs:
3333 steps :
3434 - uses : actions/checkout@v4
3535 - uses : actions/setup-python@v4
36- if : matrix.os != 'ubuntu-latest'
36+ if : ${{ !startsWith( matrix.os, 'ubuntu') }}
3737 with :
3838 python-version : ' 3.10'
3939 - uses : actions/setup-python@v4
40- if : matrix.os == 'ubuntu-latest'
40+ if : ${{ startsWith( matrix.os, 'ubuntu') }}
4141 # for testing due to docker env issues
4242 with :
4343 python-version : ' 3.9'
4646 python -m pip install --upgrade pip
4747 python -m pip install --upgrade cibuildwheel
4848 - name : Restore postgres build from cache
49- if : ${{ matrix.os != 'ubuntu-latest' }}
49+ if : ${{ !startsWith( matrix.os, 'ubuntu') }}
5050 id : restore-postgres
5151 uses : actions/cache/restore@v3
5252 env :
@@ -58,14 +58,14 @@ jobs:
5858 key : ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{
5959 hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }}
6060 - name : Build postgres and pgvector
61- if : ${{ matrix.os != 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
61+ if : ${{ !startsWith(matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }}
62+ # Run `make` now so that we may cache the postgres build before running cibuildwheel
63+ # (On Linux cibuildwheel runs in a docker container, so this won't work)
6264 env :
6365 MACOSX_DEPLOYMENT_TARGET : ${{ matrix.deployment-target }}
64- # this step is implied by Build wheels, but we do it here for caching before python tests run
65- # on ubuntu, cibuildwheel will run this step within a docker container, so it cannot use the cache this way
6666 run : make
6767 - name : Save postgres build
68- if : ${{ matrix.os != 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
68+ if : ${{ !startsWith( matrix.os, 'ubuntu') && !steps.restore-postgres.outputs.cache-hit }}
6969 id : cache-postgres
7070 uses : actions/cache/save@v3
7171 env :
8282 CIBW_SKIP : pp* cp313-* *-musllinux*
8383 MACOSX_DEPLOYMENT_TARGET : ${{ matrix.deployment-target }}
8484 run : python -m cibuildwheel --output-dir wheelhouse
85- - name : Save postgres build
86- if : ${{ matrix.os == 'ubuntu-latest' && ! steps.restore-postgres.outputs.cache-hit }}
87- id : cache-postgres2
88- uses : actions/cache/save@v3
89- env :
90- cache-name : cache-postgres
91- with :
92- path : |
93- pgbuild
94- src/pixeltable_pgserver/pginstall
95- key : ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{
96- hashFiles('Makefile', 'pgbuild/Makefile', '.github/workflows/build-and-test.yml') }}
9785 - uses : actions/upload-artifact@v3
9886 with :
9987 path : wheelhouse/*.whl
0 commit comments