-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (75 loc) · 2.65 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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 }}