test.yml: test on windows and macos (#290)
This commit is contained in:
parent
283ad164e5
commit
4ab1d6d6e0
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
|
@ -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
2
devscripts/configure.ps1
Normal 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
2
devscripts/configure.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
cp ./bdfr/default_config.cfg ./test_config.cfg
|
||||
echo -e "\nuser_token = $REDDIT_TOKEN" >> ./test_config.cfg
|
Loading…
Reference in a new issue