1+ name : Tests
2+
3+ on :
4+ push :
5+ branches : [ "**" ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ ubuntu :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ python-version : [ 3.6, 3.7, 3.8, 3.9 ]
16+ steps :
17+ - uses : actions/checkout@v2
18+ - name : Set up Python Environment ${{ matrix.python-version }}
19+ uses : actions/setup-python@v2
20+ with :
21+ python-version : ${{ matrix.python-version }}
22+ - name : Install dependencies
23+ run : |
24+ python -m pip install --upgrade pip
25+ python -m pip install flake8 pytest pylint
26+ pip install .
27+ - name : " Lint (flake8)"
28+ run : |
29+ # stop the build if there are Python syntax errors or undefined names
30+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
32+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+ - name : " Unit Tests (pytest)"
34+ run : |
35+ pytest tests/
36+ - name : " Unit Tests (commandline)"
37+ run : |
38+ camply recreation-areas --search "Yosemite National Park"
39+ camply campgrounds --rec-area 2991
40+ camply campgrounds --search "Fire Tower Lookout" --state CA
41+ camply campsites --rec-area 2991 --start-date 2021-09-15 --end-date 2021-09-16
42+ camply campsites --campground 252037 --start-date 2021-09-15 --end-date 2021-09-16
43+
44+ windows :
45+ runs-on : windows-latest
46+ strategy :
47+ fail-fast : false
48+ matrix :
49+ python-version : [ 3.6, 3.7, 3.8, 3.9 ]
50+ steps :
51+ - uses : actions/checkout@v2
52+ - name : Set up Python Environment ${{ matrix.python-version }}
53+ uses : actions/setup-python@v2
54+ with :
55+ python-version : ${{ matrix.python-version }}
56+ - name : Install dependencies
57+ run : |
58+ python -m pip install --upgrade pip
59+ python -m pip install flake8 pytest pylint
60+ pip install .
61+ shell : cmd
62+ - name : " Lint (flake8)"
63+ run : |
64+ # stop the build if there are Python syntax errors or undefined names
65+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
66+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
67+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
68+ shell : cmd
69+ - name : " Unit Tests (pytest)"
70+ run : |
71+ pytest tests/
72+ shell : cmd
73+ - name : " Unit Tests (commandline)"
74+ run : |
75+ camply recreation-areas --search "Yosemite National Park"
76+ camply campgrounds --rec-area 2991
77+ camply campgrounds --search "Fire Tower Lookout" --state CA
78+ camply campsites --rec-area 2991 --start-date 2021-09-15 --end-date 2021-09-16
79+ camply campsites --campground 252037 --start-date 2021-09-15 --end-date 2021-09-16
80+ shell : cmd
0 commit comments