1
0
Fork 0
mirror of synced 2024-05-22 05:02:45 +12:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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

2
devscripts/configure.ps1 Normal file
View file

@ -0,0 +1,2 @@
copy .\\bdfr\\default_config.cfg .\\test_config.cfg
echo "`nuser_token = $env:REDDIT_TOKEN" >> ./test_config.cfg

2
devscripts/configure.sh Executable file
View file

@ -0,0 +1,2 @@
cp ./bdfr/default_config.cfg ./test_config.cfg
echo -e "\nuser_token = $REDDIT_TOKEN" >> ./test_config.cfg