-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4834233
commit dc6edd8
Showing
8 changed files
with
124 additions
and
388 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,41 @@ | ||
name: Release to PyPI | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.1 | ||
- name: Verify versioning | ||
run: | | ||
[ "$(poetry version -s)" == "${GITHUB_REF#refs/tags/v}" ] | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Run tests | ||
run: poetry run pytest | ||
- name: Build packages | ||
run: poetry build | ||
- name: Configure Poetry | ||
run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
poetry config pypi-token.pypi "${{ secrets.PYPI_API_TOKEN }}" | ||
- name: Publish to test PyPI | ||
if: ${{ github.event_name == 'push' }} | ||
run: poetry publish -r testpypi | ||
- name: Publish to PyPI | ||
if: ${{ github.event_name == 'release' }} | ||
run: poetry publish |
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,43 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-20.04' ] | ||
python-version: [ '3.8', '3.9', '3.10' ] | ||
poetry-version: [ '1.1' ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Run tests | ||
run: poetry run pytest --cov=sigma --cov-report term --cov-report xml:cov.xml -vv | ||
- name: Store coverage for badge | ||
if: ${{ runner.os == 'Linux' }} | ||
run: poetry run python print-coverage.py >> $GITHUB_ENV | ||
- name: Create coverage badge | ||
if: ${{ github.repository == 'SigmaHQ/pySigma-pipeline-windows ' && github.event_name == 'push' && runner.os == 'Linux' }} | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.GIST_SECRET }} | ||
gistID: 143d6c718b5bbc9fb7c0e33ed06b0f85 | ||
filename: SigmaHQ-pySigma-pipeline-windows.json | ||
label: Coverage | ||
message: ${{ env.COVERAGE }} | ||
color: ${{ env.COVERAGE_COLOR }} |
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,6 @@ | ||
.coverage* | ||
.vscode/ | ||
**/__pycache__ | ||
cov.xml | ||
dist/ | ||
docs/_build |
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
Oops, something went wrong.