Skip to content

Commit

Permalink
add new gitlab action (#3)
Browse files Browse the repository at this point in the history
* add github action

* minor readme update
  • Loading branch information
felix-ht authored Dec 4, 2024
1 parent 4984741 commit 3d0eb64
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pipx install poetry
- name: Install dependencies
run: |
brew install cairo
poetry env use python${{ matrix.python-version }}
poetry install
- name: Lint with flake8
run: |
poetry run flake8
- name: Lint with black
run: poetry run black --check .
- name: Test with pytest
run: |
poetry run pytest
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ The project includes unit tests to ensure the functionality of various component
pytest
```

Note that if you have a different cairo version installed some tests might fail. This is due to the fact that the tests compare the rendered images with reference images. If you have a different cairo version installed, the images might look slightly different.


## Output Example

The image below is an example of a map created using the Mapsy library:
Expand Down
1 change: 0 additions & 1 deletion mapsy/icon/icon.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass
import os
from pathlib import Path

from mapsy.common import IconAlign
Expand Down
1 change: 0 additions & 1 deletion test/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
import mapsy
from contextlib import contextmanager
from os import path
Expand Down

0 comments on commit 3d0eb64

Please sign in to comment.