ci: expand CI checks and make consumer sync opt-in
- Add Go, npm, Python, and Java validation to CI - Run Go tests against PostgreSQL - Record performance fixes in the report
This commit is contained in:
1 parent
199a5efaef
commit
22887fef03
100 files changed
+9740
-429
No files matched your search
@@ -43,8 +43,14 @@ jobs:
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Check the generated root stylesheet is current
|
||||
run: git diff --exit-code -- shared-styles.css
|
||||
- name: Check for skipped tests
|
||||
run: npm run media:enforce:no-skipped-tests
|
||||
- name: Run Node/Svelte lint checks
|
||||
run: npm run lint
|
||||
- name: Check Prettier formatting
|
||||
run: npm run format:check
|
||||
|
||||
go:
|
||||
name: Lint (Go)
|
||||
|
||||
@@ -54,6 +54,26 @@ jobs:
|
||||
defaults:
|
||||
run:
|
||||
working-directory: backend
|
||||
# A throwaway PostgreSQL for the tests that need a real database (the auth store, the
|
||||
# platform-user SQL, mediacore's routes and the migrate package). Without these two
|
||||
# variables those tests skip themselves.
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: scratch
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 10
|
||||
env:
|
||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/scratch?sslmode=disable
|
||||
SHARED_TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/scratch?sslmode=disable
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -62,8 +82,9 @@ jobs:
|
||||
with:
|
||||
go-version-file: backend/go.mod
|
||||
cache: true
|
||||
# -p 1 runs one package at a time, because the database tests share one scratch database.
|
||||
- name: Run Go tests
|
||||
run: go test ./...
|
||||
run: go test -p 1 ./...
|
||||
|
||||
python:
|
||||
name: Test (Python)
|
||||
@@ -81,3 +102,24 @@ jobs:
|
||||
run: python -m pip install --upgrade pip -e "packages/python-backend[fastapi]"
|
||||
- name: Run Python tests
|
||||
run: python -m unittest discover -s packages/python-backend/tests -p 'test_*.py'
|
||||
|
||||
java:
|
||||
name: Test (Java)
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/java-backend
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
cache: maven
|
||||
cache-dependency-path: packages/java-backend/pom.xml
|
||||
- name: Run Java tests
|
||||
run: mvn -B test
|
||||
Reference in new issue
Block a user