-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.56 KB
/
django.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
name: Django CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
SECRET_KEY: test-secret
DATABASE_URL: mysql://root:[email protected]:3306/epub_core?init_command=SET sql_mode='STRICT_TRANS_TABLES'&charset=utf8mb4
CACHE_URL: locmemcache://
DB_DATABASE: epub_core
DB_USER: root
DB_PASSWORD: root
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
- name: Run Tests
run: |
coverage run --source='./' manage.py test --settings=epub_python_core.settings
coverage xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}