Skip to content

Commit

Permalink
Use Poetry to build project (#30)
Browse files Browse the repository at this point in the history
* use poetry

* use poetry

* enable for PR

* update poetry

* run on ubuntu only

* add injector

* add mock
  • Loading branch information
wuan authored Sep 25, 2024
1 parent d0a1cf4 commit 71a22db
Show file tree
Hide file tree
Showing 6 changed files with 882 additions and 182 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,44 @@ on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
poetry-version: [ "1.7.1", "1.8.3" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run image
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Setup environment
run: poetry install

- name: Run Tests
run: |
python -m pip install -U pip pip-tools
./update_requirements
pip install --use-pep517 -r requirements_tests.txt
pytest --cov blitzortung --cov-report xml --cov-report term --junitxml=junit.xml tests
poetry run pytest --cov blitzortung --cov-report xml --cov-report term --junitxml=junit.xml tests
- name: Build
run: |
pip install -q build
python -m build -s
poetry build
- uses: sonarsource/sonarqube-scan-action@v3
if: matrix.python-version == '3.10'
if: matrix.python-version == '3.10' && matrix.poetry-version == '1.7.1'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
Expand Down
Loading

0 comments on commit 71a22db

Please sign in to comment.