diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0f669956e..6b9e4317b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,13 @@ on: pull_request: branches: - '**' + push: + branches: + - main + +concurrency: + group: python-ci-${{ github.ref }} + cancel-in-progress: true jobs: run-ci: @@ -14,8 +21,15 @@ jobs: strategy: matrix: - os: [macos-latest, ubuntu-latest] + # Pull requests use the three Linux versions plus one representative + # macOS lane. Exact main retains the complete two-OS matrix. + os: ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest"]') }} python-version: ['3.10', '3.11', '3.12'] + include: + # On pull requests, add the one representative macOS lane. On main + # this matches an existing full-matrix entry rather than adding one. + - os: macos-latest + python-version: '3.12' steps: - name: Checkout code @@ -25,6 +39,8 @@ jobs: uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml - name: Install dependencies run: | diff --git a/.github/workflows/notify-docs.yml b/.github/workflows/notify-docs.yml index a7efeb9fa..070b9eb6b 100644 --- a/.github/workflows/notify-docs.yml +++ b/.github/workflows/notify-docs.yml @@ -2,6 +2,11 @@ name: Notify docs on: push: branches: [main] + paths: + - README.md + - CHANGELOG.md + release: + types: [published] jobs: notify: runs-on: ubuntu-latest