From 48534d29085ad69523798897dadbf05b6f2cc37b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 7 Mar 2026 06:52:30 +0000 Subject: [PATCH] Reduce GitHub Actions cost: drop Python matrix, add caching and concurrency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit validate-chapters.yml: - Remove 3-version Python matrix (3.10/3.11/3.12) — use single 3.11 (this is content/structure validation, not a library compatibility test) - Add pip cache via setup-python cache option - Add concurrency group to cancel superseded runs deploy-site.yml: - Add path filters (docs/**, mkdocs.yml, chapters/*/README.md) to skip deploys when no documentation changed - Add pip cache via setup-python cache option - Add concurrency group to cancel superseded runs Co-authored-by: Luigi Pascal Rondanini --- .github/workflows/deploy-site.yml | 9 +++++++++ .github/workflows/validate-chapters.yml | 12 +++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 6f7f700..48b8ac8 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -3,10 +3,18 @@ name: Deploy Website on: push: branches: [main] + paths: + - 'docs/**' + - 'mkdocs.yml' + - 'chapters/*/README.md' permissions: contents: write +concurrency: + group: deploy-site + cancel-in-progress: true + jobs: deploy: runs-on: ubuntu-latest @@ -17,6 +25,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" + cache: pip - name: Install dependencies run: pip install mkdocs-material mkdocs-minify-plugin diff --git a/.github/workflows/validate-chapters.yml b/.github/workflows/validate-chapters.yml index 5519654..4b6df43 100644 --- a/.github/workflows/validate-chapters.yml +++ b/.github/workflows/validate-chapters.yml @@ -14,20 +14,22 @@ on: - 'interactive/**' - 'templates/**' +concurrency: + group: validate-${{ github.ref }} + cancel-in-progress: true + jobs: validate: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.11" + cache: pip - name: Install dependencies run: |