1
0
Fork 0
mirror of synced 2024-06-25 17:40:17 +12:00
bulk-downloader-for-reddit/.github/workflows/test.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

name: Python Test
on:
push:
2021-04-21 04:07:20 +12:00
branches: [ master ]
pull_request:
2021-04-21 04:07:20 +12:00
branches: [ master ]
jobs:
test:
2021-04-20 08:50:08 +12:00
runs-on: ubuntu-latest
2021-04-20 08:50:08 +12:00
strategy:
matrix:
python-version: [3.9]
2021-04-20 08:50:08 +12:00
steps:
2021-04-20 08:50:08 +12:00
- uses: actions/checkout@v2
2021-04-20 08:50:08 +12:00
- name: Setup Python
uses: actions/setup-python@v2
with:
2021-04-20 08:50:08 +12:00
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
2021-04-21 01:43:25 +12:00
python -m pip install --upgrade pip flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2021-04-20 08:50:08 +12:00
- name: Setup test configuration
run: |
cp bdfr/default_config.cfg ./test_config.cfg
2021-04-20 08:50:08 +12:00
echo -e "\nuser_token = ${{ secrets.REDDIT_TEST_TOKEN }}" >> ./test_config.cfg
- name: Lint w/ flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
2021-04-20 08:50:08 +12:00
- name: Test w/ PyTest
run: |
pytest -m 'not slow' --verbose --cov=./bdfr/ --cov-report term:skip-covered --cov-report html
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage_report
path: htmlcov/