Skip to content

Commit 234ba7d

Browse files
authored
Merge pull request #3 from DesignBuilderSoftware/test-github-action
test-github-action
2 parents ddde0e5 + 3fdad2f commit 234ba7d

File tree

2 files changed

+51
-40
lines changed

2 files changed

+51
-40
lines changed

.github/workflows/run-tests.yml

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,70 @@ on:
55
pull_request:
66
branches:
77
- master
8-
8+
99
defaults:
1010
run:
1111
shell: bash
12-
12+
1313
jobs:
1414
linting:
1515
runs-on: windows-latest
1616
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
2727
tests:
2828
needs: linting
2929
runs-on: ${{ matrix.os }}
3030
strategy:
3131
matrix:
3232
python-version: [ 3.8, 3.9 ]
3333
os: [ ubuntu-latest, macOS-latest, windows-latest ]
34+
fail-fast: false
3435
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:
3840
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
File renamed without changes.

0 commit comments

Comments
 (0)