Adds continuous integration with Github Actions
This commit is contained in:
committed by
Ali Parlakci
parent
f483f24e15
commit
e8abec43a6
34
.github/workflows/test.yml
vendored
Normal file
34
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Python Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ v2 ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ v2 ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python 3.9
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.9
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install flake8 pytest
|
||||||
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
|
- name: Setup config file
|
||||||
|
run: |
|
||||||
|
cp bdfr/default_config.cfg ./test_config.cfg
|
||||||
|
echo "" >> ./test_config.cfg
|
||||||
|
echo "user_token = ${{ secrets.REDDIT_TEST_TOKEN }}" >> ./test_config.cfg
|
||||||
|
- 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
|
||||||
|
- name: Test with pytest
|
||||||
|
run: |
|
||||||
|
pytest -m 'not slow' --verbose
|
||||||
Reference in New Issue
Block a user