Skip to content

Commit

Permalink
setup github action for linter and unit tests
Browse files Browse the repository at this point in the history
Co-authored-by: Jochum Börger <[email protected]>
Co-authored-by: Lennart Tange <[email protected]>
  • Loading branch information
Lennart and jochumb committed Mar 5, 2024
1 parent 6319b86 commit 36d240f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/python-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python check

on:
push:
branches: [ "main", "ci/*" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12.1

- name: Install poetry
run: |
sudo apt update && sudo apt install pipx && pipx ensurepath && pipx install poetry==1.8.2
- name: Cache the virtualenv
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
run: |
poetry install
- name: Lint
run: |
poetry run pylint playground tests
- name: Tests
run: |
poetry run pytest tests
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This playground contains a basic set-up to interact with the data using [Jupyter
# How to play

## Prerequisites
- [Python >= 3.11](https://www.python.org/downloads/)
- [Python >= 3.12](https://www.python.org/downloads/)
- [Poetry](https://python-poetry.org/docs/#installation)
- Access to a DevLake database
- A place to run a Jupyter Notebook (e.g. [VS Code](https://code.visualstudio.com/))
Expand Down
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

0 comments on commit 36d240f

Please sign in to comment.