From a0062cd4199033bf1a8ced0ed17ec2b92fa9a8f7 Mon Sep 17 00:00:00 2001 From: Villon CHEN Date: Wed, 29 Oct 2025 16:23:28 +0100 Subject: [PATCH 1/3] chore: run tests on pull request --- .github/workflows/run-tests.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/run-tests.yaml diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 0000000..1503f2d --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,14 @@ +name: Run Tests on Pull Request + +on: + pull_request + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run tests + run: make test \ No newline at end of file From ad9fc06755c751bf50ad85771dafdedb605e8ff5 Mon Sep 17 00:00:00 2001 From: Villon CHEN Date: Thu, 30 Oct 2025 09:40:41 +0100 Subject: [PATCH 2/3] ci(tests): run tests only when code or tests are modified --- .github/workflows/run-tests.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 1503f2d..f0fd597 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -1,7 +1,12 @@ -name: Run Tests on Pull Request +name: Run tests on Pull Request on: - pull_request + pull_request: + branches: + - 'main' + paths: + - 'codesectools/**' + - 'tests/**' jobs: tests: From b4f875e4951295dcfae52bdd49981b60f52bbc8a Mon Sep 17 00:00:00 2001 From: Villon CHEN Date: Thu, 30 Oct 2025 09:41:02 +0100 Subject: [PATCH 3/3] ci(docs): deploy docs on GitHub Pages on push --- .github/workflows/deploy-docs.yaml | 35 ++++++++++++++++++++++++++++++ Makefile | 5 +---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy-docs.yaml diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml new file mode 100644 index 0000000..048fed7 --- /dev/null +++ b/.github/workflows/deploy-docs.yaml @@ -0,0 +1,35 @@ +name: Publish docs to GitHub Pages +on: + push: + branches: + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + + - name: Install uv + uses: astral-sh/setup-uv@v6 + + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: ~/.cache + restore-keys: | + mkdocs-material- + + - name: Install dependencies + run: uv sync --locked --all-extras --dev + + - name: Build docs + run: uv run mkdocs gh-deploy --force \ No newline at end of file diff --git a/Makefile b/Makefile index 132223d..d9dc807 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,4 @@ test-debug: ## Spawn an interactive shell in the test container to debug @docker compose run --rm test /bin/bash doc-serve: ## Serve the documentation locally - @mkdocs serve - -doc-deploy: ## Build and deploy docs to the gh-pages branch - @mkdocs gh-deploy --no-history --force --strict \ No newline at end of file + @mkdocs serve \ No newline at end of file