-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add integration and deployment pipelines
- Loading branch information
1 parent
3532c31
commit a3af56e
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Continous Delivery | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/pylistenbrainz | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: pip install .[build] | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Continous Integration | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9"] #, "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: pip install .[tests] | ||
- name: Run tests | ||
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=pylistenbrainz --cov-report=xml:junit/coverage-${{ matrix.python-version }}.xml | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: junit-${{ matrix.python-version }} | ||
path: junit/* | ||
|
||
report: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: Publish Test Reports | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
if: always() | ||
with: | ||
files: junit-*/test-results-*.xml | ||
- name: Create Coverage Report | ||
uses: irongut/CodeCoverageSummary@v1.3.0 | ||
with: | ||
filename: junit-*/coverage-*.xml | ||
format: markdown | ||
output: both | ||
- name: Add coverage PR comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
path: code-coverage-results.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ pip-log.txt | |
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
junit | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
|