mirror of
https://github.com/suitenumerique/messages.git
synced 2026-08-23 16:02:26 +02:00
129 lines
3.3 KiB
YAML
129 lines
3.3 KiB
YAML
name: Lint and tests
|
|
|
|
"on":
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
|
|
# Default to least-privilege at the workflow scope. Jobs that need
|
|
# more (e.g. opening / editing comments) opt in explicitly.
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
COMPOSE_BAKE: true
|
|
|
|
jobs:
|
|
|
|
lint-back:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Run linting checks
|
|
run: make lint-back
|
|
|
|
|
|
typecheck-jmap-email:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Run pyright (strict) on the jmap-email library
|
|
run: make typecheck-jmap-email
|
|
|
|
|
|
test-back:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_USER: 1001
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Setup data directories
|
|
run: |
|
|
mkdir -p data/static
|
|
chown -R 1001:1001 data
|
|
- name: Collect static files
|
|
run: make collectstatic
|
|
- name: Create object storage buckets
|
|
run: make create-buckets
|
|
- name: Run backend tests
|
|
run: make test-back-parallel
|
|
|
|
test-front:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Install frontend dependencies
|
|
run: make install-frozen-front
|
|
- name: Run frontend tests
|
|
run: make test-front
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_USER: 1001
|
|
PW_TEST_HTML_REPORT_OPEN: 'never'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Run E2E tests only for Chromium browser to speed up the tests
|
|
run: make test-e2e-ci args="--project chromium"
|
|
|
|
lint-front:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Install frontend dependencies
|
|
run: make install-frozen-front
|
|
- name: Run frontend linting
|
|
run: make lint-front
|
|
- name: Run frontend check
|
|
run: make typecheck-front
|
|
|
|
build-front:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Install frontend dependencies
|
|
run: make install-frozen-front
|
|
- name: Build frontend
|
|
run: make build-front
|
|
|
|
check-api-state:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Create env files
|
|
run: make create-env-files
|
|
- name: Install frontend dependencies
|
|
run: make install-frozen-front
|
|
- name: Run API update
|
|
run: make api-update
|
|
- name: Check for changes
|
|
run: |
|
|
git diff --quiet || \
|
|
(echo "API changes detected. Please run 'make api-update' then commit the changes." && exit 1)
|