Merge pull request #1367 from gafderks/dependabot/pip/coverage-7.6.1 #3071
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: Django CI | |
on: | |
push: | |
pull_request_target: | |
jobs: | |
build: | |
environment: CI | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.12'] | |
env: | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
DATABASE_URL: 'sqlite:///db.sqlite3' | |
DEBUG: off | |
NODE_ENV: production | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fallback SECRET_KEY | |
if: ${{ github.actor == 'dependabot[bot]' }} | |
run: echo "SECRET_KEY=fallbacktc5*3ih&7ru&4&#!l7uyu5ufvwtplg+bw5t9(%-ra_qb&%x*rp" >> $GITHUB_ENV | |
- name: Install GNU gettext | |
run: sudo apt-get install gettext | |
- name: Install Firefox | |
uses: browser-actions/setup-firefox@latest | |
- name: Install Selenium dependencies | |
run: | | |
sudo apt-get install xvfb | |
wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz | |
mkdir geckodriver | |
tar -xzf geckodriver-v0.33.0-linux64.tar.gz -C geckodriver | |
export PATH=$PATH:$PWD/geckodriver | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pipenv' | |
- name: Install pipenv | |
run: python -m pip install --upgrade pipenv wheel | |
- name: Install python dependencies | |
run: pipenv install --deploy --dev | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install NPM dependencies | |
run: npm ci | |
- name: Prepare application | |
run: | | |
pipenv run python manage.py migrate | |
pipenv run python manage.py collectstatic --noinput | |
pipenv run python manage.py compilemessages | |
- name: Run unit tests | |
run: | | |
pipenv run coverage run manage.py test --exclude-tag=functional -v 2 | |
pipenv run coverage xml | |
- name: Codecov functional tests | |
uses: codecov/[email protected] | |
with: | |
files: ./coverage.xml | |
flags: unit | |
- name: Run functional tests | |
run: | | |
pipenv run coverage run manage.py test --tag=functional -v 2 | |
pipenv run coverage xml | |
- name: Codecov functional tests | |
uses: codecov/[email protected] | |
with: | |
files: ./coverage.xml | |
flags: functional | |
- name: CodeClimate | |
uses: paambaati/[email protected] | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |