-
Notifications
You must be signed in to change notification settings - Fork 20
88 lines (80 loc) · 2.86 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: spid-django
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
django-version:
- '2.2'
- '3.1'
- '3.2'
- 'master'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install xmlsec1
python -m pip install --upgrade pip tox rstcheck setuptools codecov
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
#
# force pplnx's pysaml2 due to spid-sp-test requirements
#
pip uninstall -y pysaml2
pip install --no-cache --upgrade git+https://github.com/peppelinux/[email protected]#pysaml2
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# flake8 ./src/djangosaml2_spid --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ./src/djangosaml2_spid --count --exit-zero --statistics
- name: Test with Django tests
working-directory: ./example
run: |
coverage erase
coverage run ./manage.py test djangosaml2_spid
coverage report -m
# coverage report --fail-under=99
coverage xml
- name: Test SPID QA with spid-sp-test
working-directory: ./example
run: |
bash run.sh > /dev/null 2>&1 &
sleep 5
spid_sp_test --metadata-url https://localhost:8000/spid/metadata/ --authn-url https://localhost:8000/spid/login/?idp=https://localhost:8080 --extra --debug ERROR -tr
- name: Test Django reusable app
working-directory: .
run: |
pip install -e .
python runtests.py
#- name: Upload coverage to Codecov
#uses: codecov/codecov-action@v1
#with:
#token: ${{ secrets.CODECOV_TOKEN }}
#file: example/coverage.xml
#flags: unittests
#env_vars: OS,PYTHON
#name: codecov-umbrella
#fail_ci_if_error: true
#path_to_write_report: ./codecov_report.txt
# verbose: true
#- name: Bandit Security Scan
#run: |
#bandit -r -x tests.py,src/cms/api/tests src/cms/*