|
5 | 5 | pull_request:
|
6 | 6 | branches:
|
7 | 7 | - master
|
8 |
| - |
| 8 | + |
9 | 9 | defaults:
|
10 | 10 | run:
|
11 | 11 | shell: bash
|
12 |
| - |
| 12 | + |
13 | 13 | jobs:
|
14 | 14 | linting:
|
15 | 15 | runs-on: windows-latest
|
16 | 16 | steps:
|
17 |
| - - uses: actions/checkout@v2 |
18 |
| - - name: Set up Python |
19 |
| - uses: actions/setup-python@v2 |
20 |
| - with: |
21 |
| - python-version: 3.8 |
22 |
| - - name: Install dependencies |
23 |
| - run: | |
24 |
| - python -m pip install --upgrade pip |
25 |
| - pip install flake8 |
26 |
| - flake8 --count --exit-zero --max-complexity=10 --max-line-length=96 --statistics |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - name: Set up Python |
| 19 | + uses: actions/setup-python@v2 |
| 20 | + with: |
| 21 | + python-version: 3.8 |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + python -m pip install --upgrade pip |
| 25 | + pip install flake8 |
| 26 | + flake8 --count --exit-zero --max-complexity=10 --max-line-length=96 --statistics |
27 | 27 | tests:
|
28 | 28 | needs: linting
|
29 | 29 | runs-on: ${{ matrix.os }}
|
30 | 30 | strategy:
|
31 | 31 | matrix:
|
32 | 32 | python-version: [ 3.8, 3.9 ]
|
33 | 33 | os: [ ubuntu-latest, macOS-latest, windows-latest ]
|
| 34 | + fail-fast: false |
34 | 35 | steps:
|
35 |
| - - uses: actions/checkout@v2 |
36 |
| - - name: Set up Python ${{ matrix.python-version }} |
37 |
| - with: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + - name: Set up Python ${{ matrix.python-version }} |
| 38 | + uses: actions/setup-python@v2 |
| 39 | + with: |
38 | 40 | python-version: ${{ matrix.python-version }}
|
39 |
| - |
40 |
| - - name: Get full python version |
41 |
| - id: full-python-version |
42 |
| - run: | |
43 |
| - echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))") |
44 |
| - |
45 |
| - - name: Set up Poetry |
46 |
| - run: | |
47 |
| - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python |
48 |
| - echo "$HOME/.poetry/bin" >> $GITHUB_PATH |
49 |
| - |
50 |
| - - name: Configure poetry |
51 |
| - run: poetry config virtualenvs.in-project true |
52 |
| - |
53 |
| - - name: Set up cache |
54 |
| - uses: actions/cache@v2 |
55 |
| - with: |
56 |
| - path: .venv |
57 |
| - key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} |
58 |
| - |
59 |
| - - name: Install dependencies |
60 |
| - run: poetry install |
61 |
| - |
62 |
| - - name: Test with pytest |
63 |
| - run: poetry run pytest -v |
| 41 | + |
| 42 | + - name: Get full python version |
| 43 | + id: full-python-version |
| 44 | + run: | |
| 45 | + echo python -c "import sys; print('.'.join(str(v) for v in sys.version_info[:2]))" |
| 46 | + echo python -c "import sys; print(sys.executable)" |
| 47 | +
|
| 48 | + - name: Set up Poetry |
| 49 | + run: | |
| 50 | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 - -y |
| 51 | +
|
| 52 | + - name: Add poetry to path (Windows) |
| 53 | + if: ${{ matrix.os == 'windows-latest' }} |
| 54 | + run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH |
| 55 | + |
| 56 | + - name: Add poetry to path (MacOS or Ubuntu) |
| 57 | + if: ${{ matrix.os != 'windows-latest' }} |
| 58 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 59 | + |
| 60 | + - name: Configure poetry |
| 61 | + run: | |
| 62 | + poetry config virtualenvs.in-project true |
| 63 | +
|
| 64 | + - name: Set up cache |
| 65 | + uses: actions/cache@v2 |
| 66 | + with: |
| 67 | + path: .venv |
| 68 | + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} |
| 69 | + |
| 70 | + - name: Install dependencies |
| 71 | + run: poetry install |
| 72 | + |
| 73 | + - name: Test with pytest |
| 74 | + run: poetry run pytest tests/test_db_temperature_distribution.py -v |
0 commit comments