diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml index 437d0345c0a..0b3f6401bc2 100644 --- a/.github/workflows/ci-meson.yml +++ b/.github/workflows/ci-meson.yml @@ -16,7 +16,7 @@ concurrency: jobs: test: - name: Conda (${{ matrix.os }}, Python ${{ matrix.python }}) + name: Conda (${{ matrix.os }}, Python ${{ matrix.python }}${{ matrix.editable && ', editable' || '' }}) runs-on: ${{ matrix.os }}-latest strategy: @@ -24,6 +24,20 @@ jobs: matrix: os: [ubuntu] python: ['3.11', '3.12'] + editable: [false, true] + is-pull-request: + - ${{ github.event_name == 'pull_request' }} + # trick from https://github.com/orgs/community/discussions/26253#discussioncomment-6745038 + # in PR, only run the combinations listed below; otherwise, run all combinations + exclude: + - is-pull-request: true + include: + - os: ubuntu + python: 3.11 + editable: false + - os: ubuntu + python: 3.12 + editable: true steps: - uses: actions/checkout@v4 @@ -70,7 +84,7 @@ jobs: export CC="ccache $CC" export CXX="ccache $CXX" # Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda - pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v + pip install --no-build-isolation --no-deps --config-settings=builddir=builddir ${{ matrix.editable && '--editable' || '' }} . -v - name: Check update-meson # this step must be after build, because meson.build creates a number of __init__.py files @@ -93,12 +107,14 @@ jobs: shell: bash -l {0} run: | # We don't install sage_setup, so don't try to test it - rm -R ./src/sage_setup/ + # If editable then deleting the directory will cause sage to detect rebuild, which will cause ninja to fail + # so we don't delete the directory in this case + ${{ matrix.editable && 'true' || 'rm -R ./src/sage_setup/' }} ./sage -t --all -p4 --format github - name: Upload log uses: actions/upload-artifact@v4.5.0 if: failure() with: - name: ${{ runner.os }}-meson-${{ matrix.python }}-log + name: ${{ runner.os }}-meson-${{ matrix.python }}${{ matrix.editable && '-editable' || '' }}-log path: builddir/meson-logs/