CI #6162
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Enable Buildkit and let compose use it to speed up image building | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
on: | |
pull_request: | |
branches: ["master", "main"] | |
paths-ignore: ["docs/**"] | |
push: | |
branches: ["master", "main"] | |
paths-ignore: ["docs/**"] | |
merge_group: | |
jobs: | |
build-scss: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: Set up node | |
uses: actions/setup-node@v4.1.0 | |
- name: Install node dependencies | |
run: npm ci | |
- name: Build scss | |
run: npm run build | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5.3.0 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: | | |
requirements/base.txt | |
requirements/local.txt | |
- name: Run pre-commit | |
uses: pre-commit/action@v3.0.1 | |
env: | |
SKIP: no-commit-to-branch,stylelint | |
static-analysis: | |
runs-on: ubuntu-latest | |
needs: linter | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: Copy .env.example file | |
uses: canastro/copy-file-action@master | |
with: | |
source: ".env.example" | |
target: ".env" | |
- name: Build the Stack | |
run: docker compose build django postgres | |
- name: Run mypy | |
run: docker compose run django mypy ds_caselaw_editor_ui judgments | |
# With no caching at all the entire ci process takes 4m 30s to complete! | |
pytest: | |
runs-on: ubuntu-latest | |
needs: linter | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v4 | |
- name: Copy .env.example file | |
uses: canastro/copy-file-action@master | |
with: | |
source: ".env.example" | |
target: ".env" | |
- name: Build the Stack | |
run: docker compose build postgres django | |
- name: Run DB Migrations | |
run: docker compose run --rm django python manage.py migrate --settings=config.settings.test | |
- name: Run Django Tests with coverage | |
run: docker compose run django coverage run -m pytest | |
- name: Generate coverage XML | |
run: docker compose run django coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
- name: Upload coverage to CodeClimate | |
uses: paambaati/codeclimate-action@v9.0.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | |
- name: Tear down the Stack | |
run: docker compose down |