green-spider/.github/workflows/test.yaml
Marian Steinbach 51052ebac1
Add tests action (#273)
* Add tests action

* Change test execution command

* Change action towards building a docker image

* Use pyyaml from alpine package

* Add test execution

* Enable running without terminal in CI

* Add creation of empty secret file

* Fill service account file

* Fix JSON

* Fix quiting

* Add more fields to fake secret

* Wrap execution in try/except

* Fix: local variable 'result' referenced before assignment
2022-10-21 16:27:15 +02:00

36 lines
1.3 KiB
YAML

name: Python tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: make dockerimage
- name: Create placeholder secrets
run: |
mkdir ./secrets
echo '{"token_uri": "", "client_email": "", "private_key": "", "private_key_id": "", "client_id": ""}' >> ./secrets/screenshots-uploader.json
- name: Run tests in Docker image
run: make test
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Execute unit tests
# run: |
# python -m unittest discover -p '*_test.py' -v