-
Notifications
You must be signed in to change notification settings - Fork 0
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
b9c9b39
commit fb363fe
Showing
8 changed files
with
144 additions
and
16 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
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
name: Docs | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- workflow_call | ||
|
||
permissions: | ||
contents: write | ||
|
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,40 @@ | ||
name: Github Release | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
|
||
github-release: | ||
name: >- | ||
Sign the Python 🐍 distribution 📦 with Sigstore | ||
and upload them to GitHub Release | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/gh-action-sigstore-python@v1.2.3 | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' | ||
--generate-notes |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: mypy | ||
|
||
on: | ||
- push | ||
- workflow_call | ||
|
||
jobs: | ||
|
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,25 @@ | ||
name: PYPI | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/arg-init | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: lint | ||
|
||
on: | ||
- push | ||
- workflow_call | ||
|
||
jobs: | ||
|
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,31 @@ | ||
name: test | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
test: | ||
name: run unittests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: 3.11 | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: pdm install -G test | ||
|
||
- name: Test with pytest | ||
run: pdm run pytest --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
flags: build | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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: CI | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
|
||
# Stage 1: Validate Source | ||
test: | ||
name: Test the package | ||
uses: ./.githib/workflows/test.yml | ||
|
||
mypy: | ||
name: Static Type Check the package | ||
uses: ./.githib/workflows/mypy.yml | ||
|
||
ruff: | ||
name: Lint the package | ||
uses: ./.githib/workflows/ruff.yml | ||
|
||
|
||
# Stage 2: Build Packages | ||
build: | ||
name: Build the package | ||
uses: ./.github/workflows/build.yml | ||
needs: | ||
- test | ||
- mypy | ||
- ruff | ||
|
||
# Stage 3: Release Packages and Build documentation | ||
pypi: | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
uses: ./.github/workflows/pypi.yml | ||
needs: | ||
- build | ||
|
||
github: | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to github on tag pushes | ||
uses: ./.github/workflows/github.yml | ||
needs: | ||
- build | ||
|
||
docs: | ||
uses: ./.github/workflows/docs.yml | ||
needs: | ||
- build |