Skip to content

ci: Use correct cache for yarn #335

ci: Use correct cache for yarn

ci: Use correct cache for yarn #335

Workflow file for this run

---
name: CI Tests
on:
push:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Ensure requirements.txt and pyproject.toml in sync
run: |
poetry lock --no-update
poetry export --without-hashes -o requirements.txt
git diff --exit-code
- name: Ensure server/templates/index.html is in sync with the frontend
run: |
poetry install --no-root
poetry run ./scripts/update-index-template
git diff --exit-code
- name: Ensure code has been blackened
run: poetry run black hub/ server/ scripts/ deploy/ --check
- name: Ensure no Python lint errors
run: poetry run ruff check .
- name: Ensure no Python static type errors
run: poetry run mypy .
- name: Ensure models and migrations are in sync
run: |
poetry run python manage.py makemigrations --no-input
git add server/migrations
git diff --cached --exit-code
run-django-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-root --with=dev
- name: Run Django tests
run: |
poetry run pytest --disable-warnings
frontend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Install dependencies
working-directory: './frontend'
run: yarn install --production=false
- name: Run Build
working-directory: './frontend'
run: yarn build
- name: Run Prettier
working-directory: './frontend'
run: |
npx prettier --write src/**/*.js src/*.js
git diff --exit-code
- name: Run eslint
working-directory: './frontend'
run: |
npx eslint .
git diff --exit-code