-
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.
Use pixi to run doc build and tests. Use pre-commit action to run qa. Use pypi action to handle release. Use a readthedocs workflow to build a preview for docs in a PR. Use dependabot to keep things updated. Update gitlab urls to github Add a conventional-pre-commit hook Create a COPYING file to indicate the license to Github interface Cleanup pixi settings. Add coverage reports Fix coverage badge based on that Co-authored-by: Yannick-Dayer <[email protected]>
- Loading branch information
1 parent
ca5a37b
commit fae63f8
Showing
17 changed files
with
1,350 additions
and
3,600 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,2 @@ | ||
# GitHub syntax highlighting | ||
pixi.lock linguist-language=YAML linguist-generated=true |
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,11 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
dependencies: | ||
patterns: | ||
- "*" |
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,86 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
simpletests: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.25.0 | ||
environments: self | ||
- name: Run Simple Tests | ||
shell: pixi run -e self bash -e {0} | ||
run: | | ||
gridtk --help | ||
gridtk submit --help | ||
gridtk resubmit --help | ||
gridtk stop --help | ||
gridtk list --help | ||
gridtk report --help | ||
gridtk delete --help | ||
tests: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
# Gives the action the necessary permissions for pushing data to the | ||
# python-coverage-comment-action branch, and for editing existing | ||
# comments (to avoid publishing multiple comments in the same PR) | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.25.0 | ||
environments: test | ||
- name: Run Tests | ||
run: pixi run test-ci | ||
- name: Coverage comment | ||
id: coverage_comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Store Pull Request comment to be posted | ||
uses: actions/upload-artifact@v4 | ||
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | ||
with: | ||
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly | ||
name: python-coverage-comment-action | ||
# If you use a different name, update COMMENT_FILENAME accordingly | ||
path: python-coverage-comment-action.txt | ||
|
||
doc: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.25.0 | ||
environments: doc | ||
- name: Clean previous docs | ||
run: pixi run doc-clean | ||
- name: Build docs | ||
run: pixi run doc | ||
- name: Run doctests | ||
run: pixi run doctest |
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,35 @@ | ||
name: Post coverage comment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["build"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
test: | ||
name: Run tests & display coverage | ||
runs-on: ubuntu-22.04 | ||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' | ||
permissions: | ||
# Gives the action the necessary permissions for publishing new | ||
# comments in pull requests. | ||
pull-requests: write | ||
# Gives the action the necessary permissions for editing existing | ||
# comments (to avoid publishing multiple comments in the same PR) | ||
contents: write | ||
# Gives the action the necessary permissions for looking up the | ||
# workflow that launched this workflow, and download the related | ||
# artifact that contains the comment to be published | ||
actions: read | ||
steps: | ||
# DO NOT run actions/checkout here, for security reasons | ||
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | ||
- name: Post comment | ||
uses: py-cov-action/python-coverage-comment-action@v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }} | ||
# Update those if you changed the default values: | ||
# COMMENT_ARTIFACT_NAME: python-coverage-comment-action | ||
# COMMENT_FILENAME: python-coverage-comment-action.txt |
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,20 @@ | ||
name: readthedocs preview | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
# Execute this action only on PRs that touch | ||
# documentation files. | ||
# paths: | ||
# - "docs/**" | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
documentation-links: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: readthedocs/actions/preview@v1 | ||
with: | ||
project-slug: "gridtk" |
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,17 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- uses: pre-commit/[email protected] |
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,58 @@ | ||
# From https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-pypi | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release-build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Build release distributions | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
|
||
pypi-publish: | ||
runs-on: ubuntu-22.04 | ||
|
||
needs: | ||
- release-build | ||
|
||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
# Dedicated environments with protections for publishing are strongly recommended. | ||
environment: | ||
name: pypi | ||
# include the PyPI project URL in the deployment status: | ||
url: https://pypi.org/p/gridtk | ||
|
||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
|
||
- name: Publish release distributions 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
This file was deleted.
Oops, something went wrong.
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,7 +1,7 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: gridtk | ||
Upstream-Contact: Andre Anjos <[email protected]> | ||
Source: https://gitlab.idiap.ch/software/gridtk/ | ||
Source: https://github.com/idiap/gridtk/ | ||
|
||
Files: | ||
pixi.lock | ||
|
Oops, something went wrong.