-
Notifications
You must be signed in to change notification settings - Fork 20
60 lines (54 loc) · 1.8 KB
/
basic_checks.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
name: build
on: [ pull_request, workflow_dispatch, push ]
env:
MODE: GIT_ACTIONS_DEV
DJANGO_SETTINGS_MODULE: test_app.test_settings
jobs:
basic_checks:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install requirements
run: |
python setup.py install
pip install -r requirements.txt
pip install -r requirements_test.txt
- name: Run Migrations
run: |
cd example
python manage.py migrate
- name: Run Tests
run: |
cd example
coverage run manage.py test
coverage report
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@v2
with:
working-directory: example
output: ../coverage.svg
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v14
id: verify-changed-files
with:
files: coverage.svg
- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
#mv example/coverage.svg coverage.svg
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add coverage.svg
git commit -m "Updated coverage.svg"
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.github_token }}
branch: ${{ github.ref }}