Fixed bugs regarding state preservation (#3356) #232
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: Backend | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- requirements/** | |
- docker/config/server.env.template | |
- pontoon/** | |
- .github/workflows/backend.yml | |
pull_request: | |
branches: | |
- main | |
paths: | |
- requirements/** | |
- docker/config/server.env.template | |
- pontoon/** | |
- .github/workflows/backend.yml | |
workflow_dispatch: | |
jobs: | |
test: | |
name: pytest | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: pontoon | |
POSTGRES_PASSWORD: pontoon | |
POSTGRES_DB: pontoon | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: pip | |
cache-dependency-path: | | |
requirements/default.txt | |
requirements/dev.txt | |
requirements/lint.txt | |
requirements/test.txt | |
- run: > | |
pip install | |
-r requirements/default.txt | |
-r requirements/dev.txt | |
-r requirements/test.txt | |
-r requirements/lint.txt | |
# Set environment variables | |
- run: pip install pytest-dotenv | |
- run: > | |
sed | |
-e 's#^DATABASE_URL=.*#DATABASE_URL=postgres://pontoon:pontoon@localhost/pontoon#' | |
-e '/^SITE_URL=/d' | |
docker/config/server.env.template > .env | |
# Run collectstatic with minimal dependencies, skipping the actual front-end build | |
- run: npm install | |
working-directory: pontoon | |
- run: mkdir -p tag-admin/dist translate/dist translate/public | |
- run: python manage.py collectstatic | |
- run: pytest | |
- uses: codecov/codecov-action@v4 | |
with: | |
flags: backend | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |