-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Deleted launch.json * Restructure project and changed setup configuration Added steps in README * Improved pipeline * Deleted requirements * Ruff formatted python modules * Fixed mypy * Fixed imports with new src/pyssmf structure Added missing dev dependencies * Deleted work_dir
- Loading branch information
1 parent
63e3653
commit 20e4a6a
Showing
30 changed files
with
511 additions
and
532 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,51 @@ | ||
name: install-and-test | ||
on: [push] | ||
jobs: | ||
install-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install '.[dev]' | ||
- name: mypy | ||
run: | | ||
python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional src/pyssmf tests | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest -sv tests | ||
build-and-install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Build the package | ||
run: | | ||
pip install --upgrade pip | ||
pip install build | ||
python -m build --sdist | ||
- name: Install the package | ||
run: | | ||
pip install dist/*.tar.gz | ||
ruff-linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
args: "check ." | ||
ruff-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
args: "format . --check --verbose" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: deploy-mkdocs | ||
on: | ||
push: | ||
branches: | ||
- develop # Triggers deployment on push to the main branch | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build # This ensures that the deployment job runs after the build job | ||
if: github.ref == 'refs/heads/develop' # Only deployed for the develop branch | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
mkdocs-bibtex- | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mkdocs mkdocs-material==8.1.1 pymdown-extensions mkdocs-click | ||
- name: Build MKDocs Documentation | ||
run: mkdocs build --verbose | ||
- name: Deploy MKDocs to GitHub Pages | ||
run: | | ||
if [ -n "$GITHUB_TOKEN" ]; then | ||
mkdocs gh-deploy --force | ||
else | ||
echo "Set the GH_PAGES_TOKEN secret in your repository for deploying to GitHub Pages." | ||
exit 1 | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAGES_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,82 @@ | ||
# Upload python package to pypi server and github release. | ||
# Reference: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
|
||
name: upload-to-pypi | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
# publish-to-pypi: | ||
# name: >- | ||
# Publish distribution to PyPI | ||
# runs-on: ubuntu-latest | ||
# environment: | ||
# name: pypi | ||
# url: https://pypi.org/p/nomad-schema-plugin-example | ||
# permissions: | ||
# id-token: write # IMPORTANT: mandatory for trusted publishing | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: "3.9" | ||
# - name: Install pypa/build | ||
# run: >- | ||
# python3 -m | ||
# pip install | ||
# build | ||
# --user | ||
# - name: Build a binary wheel and a source tarball | ||
# run: python3 -m build | ||
# - name: Publish distribution to PyPI | ||
# uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
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: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- 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 upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
{ | ||
"python.defaultInterpreterPath": "${workspaceFolder}/.pyenv/bin/python", | ||
"python.defaultInterpreterPath": ".pyenv/bin/python", | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
"[python]": { | ||
"editor.rulers": [ | ||
90 | ||
], | ||
"editor.renderWhitespace": "all", | ||
"editor.tabSize": 4, | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
"editor.rulers": [90], | ||
"editor.renderWhitespace": "all", | ||
"editor.tabSize": 4, | ||
"[javascript]": { | ||
"editor.tabSize": 2 | ||
}, | ||
"ruff.lint.args": ["--select=E,W,F,PL", "--ignore=E501,E701,E731,E402,PLR0911,PLR0912,PLR0913,PLR0915,PLR2004,PLW0603,PLW2901,PLR1714,PLR5501", "--exclude=__init__.py"] | ||
} | ||
|
||
"files.trimTrailingWhitespace": true, | ||
"files.watcherExclude": { | ||
"${workspaceFolder}/.pyenv/**": true | ||
}, | ||
"files.exclude": { | ||
"\"**/*.pyc\": {\"when\": \"$(basename).py\"}": true, | ||
"**/__pycache__": true, | ||
"**/node_modules": true | ||
}, | ||
"python.testing.pytestPath": "pytest", | ||
"python.testing.pytestArgs": ["tests"], | ||
"python.testing.unittestEnabled": false, | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true | ||
} | ||
|
Oops, something went wrong.