test.yml: test on windows and macos (#290)

This commit is contained in:
Ali Parlakçı
2021-05-06 13:04:41 +03:00
committed by GitHub
parent 283ad164e5
commit 4ab1d6d6e0
3 changed files with 18 additions and 12 deletions

View File

@@ -8,15 +8,17 @@ on:
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9]
ext: [.sh]
include:
- os: windows-latest
python-version: 3.9
ext: .ps1
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
@@ -26,19 +28,19 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements.txt
- name: Setup test configuration
- name: Make configuration for tests
env:
REDDIT_TOKEN: ${{ secrets.REDDIT_TEST_TOKEN }}
run: |
cp bdfr/default_config.cfg ./test_config.cfg
echo -e "\nuser_token = ${{ secrets.REDDIT_TEST_TOKEN }}" >> ./test_config.cfg
./devscripts/configure${{ matrix.ext }}
- name: Lint w/ flake8
- 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 w/ PyTest
- name: Test with pytest
run: |
pytest -m 'not slow' --verbose --cov=./bdfr/ --cov-report term:skip-covered --cov-report html