Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Poetry to build project #30

Merged
merged 7 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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