Skip to content

Avoid 403 Erroro downloading IDP metadata #278

Avoid 403 Erroro downloading IDP metadata

Avoid 403 Erroro downloading IDP metadata #278

Workflow file for this run

# 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/*