You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/ci-python-library-README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ This reusable workflow is part of the City of Helsinki's GitHub Actions setup, s
7
7
-**Commit Linting**: Enforces commit message standards using [commitlint](https://commitlint.js.org/).
8
8
-**Code Style Checks**: Verifies code style and formatting using [pre-commit](https://pre-commit.com/).
9
9
-**Automated Testing**: Runs project tests across multiple Python versions using [hatch](https://hatch.pypa.io/).
10
+
-**Database Testing**: Optionally starts a PostgreSQL (with or without PostGIS) service and sets `DATABASE_URL` for tests that require a database.
10
11
-**Code Quality Analysis**: Performs a [SonarQube Cloud](https://sonarcloud.io/) scan.
11
12
12
13
## Requirements for Projects Using the Workflow
@@ -28,6 +29,8 @@ To use this reusable workflow, create a project-specific workflow file in your `
28
29
29
30
-**`python-version`** (string): Python version to use for pre-commit checks. Defaults to `"3.x"`.
30
31
-**`enable-sonar`** (boolean): Whether to run the SonarQube Cloud Scan job after tests. Defaults to `true`.
32
+
-**`postgres-major-version`** (string): PostgreSQL major version to use for testing. Supported versions: `13`, `14`, `17`. Optional - omit if no database is needed.
33
+
-**`use-postgis`** (boolean): Set to `true` to use the PostGIS extension. Requires `postgres-major-version` to be set. Defaults to `false`.
When `postgres-major-version` is set, the workflow starts a PostgreSQL service and exposes a `DATABASE_URL` environment variable (`postgres://test_user:test_password@localhost/test_db`) to the test runner.
0 commit comments