HP-2441 | deps: bump to django 4.2 #384
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
on: | |
# Trigger analysis when pushing in develop/master or pull requests, and when creating | |
# a pull request. | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
types: [opened, synchronize, reopened] | |
name: CI Workflow | |
jobs: | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:9.6 | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
POSTGRES_USER: tunnistamo | |
POSTGRES_PASSWORD: tunnistamo | |
POSTGRES_DB: tunnistamo | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Cache pip packages | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-pip-modules | |
with: | |
path: ~/.pip-cache | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install system packages | |
run: sudo apt update && sudo apt-get install -y libxmlsec1-dev xmlsec1 gettext | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt -r requirements-dev.txt codecov | |
- name: Compile translations | |
run: python manage.py compilemessages | |
- name: Run tests | |
run: pytest -ra -vvv --cov=. | |
env: | |
DATABASE_URL: postgres://tunnistamo:tunnistamo@localhost:5432/tunnistamo | |
- name: Coverage | |
run: codecov | |
coding-style: | |
name: Coding style | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Cache pip packages | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-pip-modules | |
with: | |
path: ~/.pip-cache | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install system packages | |
run: sudo apt update && sudo apt-get install -y libxmlsec1-dev xmlsec1 | |
- name: Install Python dependencies | |
run: pip install -r requirements.txt -r requirements-dev.txt | |
- name: Linting | |
run: flake8 | |
- name: Import sorting | |
run: isort -c . | |
sonarcloud: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |