From 3911c3bf5c2e6b394b074aec170dce21252bf7c3 Mon Sep 17 00:00:00 2001 From: CapellanCitizen Date: Mon, 26 Aug 2024 00:07:29 -0400 Subject: [PATCH] Split out linux build, test, dist steps --- .github/workflows/build.yml | 10 ++++++++-- bin/{build-linux-dist => build-linux} | 15 +++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) rename bin/{build-linux-dist => build-linux} (67%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4515d63a..06d44177c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: id: geos-build-cache with: path: geos/build - key: ${{ runner.os }}-20.04-geos-build-${{ hashFiles('**/bin/build-linux-dist') }} + key: ${{ runner.os }}-20.04-geos-build-${{ hashFiles('**/bin/build-linux') }} restore-keys: | ${{ runner.os }}-20.04-geos-build- @@ -69,7 +69,13 @@ jobs: echo "${{ env.pythonLocation }}\bin" >> $GITHUB_PATH - shell: bash run: | - bin/build-linux-dist + bin/build-linux + - shell: bash + run: | + pytest + - shell: bash + run: | + make dist env: BUILD: linux INKSTITCH_GPG_KEY: ${{ secrets.INKSTITCH_GPG_KEY }} diff --git a/bin/build-linux-dist b/bin/build-linux similarity index 67% rename from bin/build-linux-dist rename to bin/build-linux index 5b591f719..c7014658f 100755 --- a/bin/build-linux-dist +++ b/bin/build-linux @@ -17,13 +17,16 @@ export PATH=$GEOS_PATH/bin:$PATH export GEOS_INCLUDE_PATH=$GEOS_PATH/include export GEOS_LIBRARY_PATH=$GEOS_PATH/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GEOS_PATH/lib +if [ ! -z "$CI" ]; then + # Write the geos path to GITHUB_PATH so successive steps can use + echo $GEOS_PATH/bin >> $GITHUB_PATH + # Set these variables in GITHUB_ENV so successive steps can use them. + echo "GEOS_INCLUDE_PATH=$GEOS_INCLUDE_PATH" >> $GITHUB_ENV + echo "GEOS_LIBRARY_PATH=$GEOS_LIBRARY_PATH" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV +fi + cd ../.. python -m pip uninstall -y shapely python -m pip cache remove shapely python -m pip install -v shapely --no-binary shapely -# Future improvement might be to split this out so pytest is a separate step and line on the build log, -# but the LD_LIBRARY_PATH env var needs to be passed between those steps with step outputs or something. -# This works for now. -pytest -make dist -