Skip to main content

all: switch from GitHub Actions to my scripts-based test runner

ID
09f0b3f
date
2026-05-27 06:43:00+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
5879424
message
all: switch from GitHub Actions to my scripts-based test runner
changed files
8 files, 55 additions, 61 deletions

Changed files

.github/dependabot.yml (321) → .github/dependabot.yml (0)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 1140073..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-version: 2
-updates:
-  - package-ecosystem: "github-actions"
-    directory: "/"
-    schedule:
-      interval: "weekly"
-      time: "09:00"
-  - package-ecosystem: "pip"
-    directory: "/"
-    schedule:
-      interval: "weekly"
-      time: "09:00"
-    ignore:
-      - dependency-name: "mypy"
-      - dependency-name: "ruff"

.github/workflows/test.yml (739) → .github/workflows/test.yml (0)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index f50751e..0000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: Test
-
-on:
-  push:
-    branches:
-    - main
-
-  pull_request:
-    branches:
-    - main
-
-jobs:
-  test:
-    strategy:
-      matrix:
-        python-version:
-          - "3.12"
-          - "3.13"
-
-    runs-on: ubuntu-latest
-
-    steps:
-    - uses: actions/checkout@v6
-
-    - name: Set up Python
-      uses: actions/setup-python@v6
-      with:
-        python-version: ${{ matrix.python-version }}
-        cache: 'pip'
-        cache-dependency-path: 'dev_requirements.txt'
-
-    - name: Install dependencies
-      run: pip install -r dev_requirements.txt
-
-    - name: Check formatting
-      run: |
-        ruff check .
-        ruff format --check .
-
-    - name: Check types
-      run: mypy . --strict
-
-    - name: Run tests
-      run: pytest

.gitignore (0) → .gitignore (10)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6350e98
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.coverage

dev_requirements.in (38) → dev_requirements.in (47)

diff --git a/dev_requirements.in b/dev_requirements.in
index ca2402a..fd3724f 100644
--- a/dev_requirements.in
+++ b/dev_requirements.in
@@ -1,5 +1,6 @@
 -r requirements.txt
 
+coverage
 mypy
 pytest
 ruff

dev_requirements.txt (664) → dev_requirements.txt (782)

diff --git a/dev_requirements.txt b/dev_requirements.txt
index ac6771b..80197fb 100644
--- a/dev_requirements.txt
+++ b/dev_requirements.txt
@@ -1,5 +1,7 @@
 # This file was autogenerated by uv via the following command:
-#    uv pip compile dev_requirements.in --output-file dev_requirements.txt
+#    uv pip compile dev_requirements.in --output-file=dev_requirements.txt --exclude-newer=P7D --exclude-newer-package alexwlchan-chives=false
+coverage==7.14.0
+    # via -r dev_requirements.in
 iniconfig==2.3.0
     # via pytest
 jinja2==3.1.6

pyproject.toml (0) → pyproject.toml (255)

diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..ce5bac3
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,15 @@
+[tool.coverage.run]
+branch = true
+source = [
+  "generate_palette_files",
+  "palette",
+  "test_vendor_css_files",
+  "vendor_css_files",
+]
+
+[tool.coverage.report]
+show_missing = true
+skip_covered = true
+
+[tool.pytest.ini_options]
+filterwarnings = ["error"]

requirements.txt (208) → requirements.txt (276)

diff --git a/requirements.txt b/requirements.txt
index 398b0bf..d0fecf2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 # This file was autogenerated by uv via the following command:
-#    uv pip compile requirements.in --output-file requirements.txt
+#    uv pip compile requirements.in --output-file=requirements.txt --exclude-newer=P7D --exclude-newer-package alexwlchan-chives=false
 jinja2==3.1.6
     # via -r requirements.in
 markupsafe==3.0.3

scripts/run_colour_scheme_tests.sh (0) → scripts/run_colour_scheme_tests.sh (651)

diff --git a/scripts/run_colour_scheme_tests.sh b/scripts/run_colour_scheme_tests.sh
new file mode 100755
index 0000000..6fb75c5
--- /dev/null
+++ b/scripts/run_colour_scheme_tests.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+# Print a command in blue, then run the command
+run_command() {
+    echo ""
+    echo -e "\033[34m-> $@\033[0m"
+    bash -c "$@"
+}
+
+report_coverage() {
+    echo ""
+    echo -e "\033[34m-> python3 -m coverage report\033[0m"
+    if [[ $(python3 -m coverage report --format=total) = "100" ]]
+    then
+        echo "100% coverage!"
+    else
+        python3 -m coverage report
+    fi
+}
+
+run_command 'ruff format'
+
+if [[ "${CI:-}" == "true" ]]
+then
+  run_command 'git diff --exit-code'
+fi
+
+run_command 'ruff check'
+run_command 'mypy *.py'
+run_command "python3 -m coverage run -m pytest -q"
+report_coverage