Skip to content

Commit

Permalink
CI: update GA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
misialq committed Jan 16, 2023
1 parent f0b49c9 commit d171fb3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
64 changes: 34 additions & 30 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
name: Run the tests
on: [push]
on:
pull_request:
branches:
- main
push:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set up PYTHONPATH
run: |
echo "::set-env name=PYTHONPATH::$PYTHONPATH:/home/runner/work/openerz-api"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest testfixtures
pytest
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up PYTHONPATH
run: |
echo "PYTHONPATH=$PYTHONPATH:/home/runner/work/openerz-api" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest testfixtures
pytest
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="openerz-api",
version="0.1.0",
version="0.2.0",
author="Michał Ziemski",
author_email="michal@terrestryal.com",
description="A Python wrapper around the OpenERZ API.",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_sensor_make_api_request():
"start": "2019-12-10",
"end": "2020-01-10",
"offset": 0,
"limit": 0,
"limit": 1,
"lang": "en",
"sort": "date",
}
Expand Down

0 comments on commit d171fb3

Please sign in to comment.