-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactored the Dockerfile to use poetry to build the whl and pip to install the application in the venv; Added GHA workflows to check code quality and to publish the package into pypi-switch * Removed phony files, added an helper to the makefile as well as checks for deps and envs * Added PYPI credentials to the build-env action * added fixes for the code quality check * reverted changes to action.yml
- Loading branch information
André
authored
Nov 20, 2021
1 parent
0077a95
commit 3472270
Showing
53 changed files
with
151 additions
and
81 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,18 @@ | ||
name: "Setup Build Environment" | ||
description: "Install everything needed to build" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Install Poetry | ||
shell: bash | ||
run: | | ||
# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 | ||
# source $HOME/.poetry/env | ||
# poetry -n init | ||
pip install --user poetry | ||
pip install "mypy==0.910" |
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: Publish Python 🐍 distributions 📦 to Switch PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.10.0 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10.0 | ||
|
||
- name: Tries to get the tag version or branch name | ||
id: context | ||
run: | | ||
echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/heads/} | ||
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/} | ||
- name: Setup the Python Environment by installing Poetry | ||
uses: ./.github/actions/setup-python-build-env | ||
|
||
- name: Poetry bump version, build and publish | ||
shell: bash | ||
run: | | ||
# TAG_VERSION can be also obtained with: | ||
# poetry version $(git describe --tags --abbrev=0) | ||
poetry version $TAG_VERSION | ||
poetry config http-basic.pypi-switch $PYPI_USER $PYPI_PASS | ||
poetry update | ||
poetry build | ||
poetry publish -r pypi-switch | ||
env: | ||
TAG_VERSION: ${{ steps.context.outputs.TAG_VERSION }} | ||
PYPI_USER: ${{ secrets.PYPI_USER }} | ||
PYPI_PASS: ${{ secrets.PYPI_PASS }} |
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,32 @@ | ||
name: PR Python 🐍 to Switch Repo | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
code-quality-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.10.0 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10.0 | ||
|
||
- name: Setup the Python Environment by installing Poetry | ||
uses: ./.github/actions/setup-python-build-env | ||
|
||
- name: Code Quality Check | ||
shell: bash | ||
run: | | ||
poetry config http-basic.pypi-switch $PYPI_USER $PYPI_PASS | ||
poetry update | ||
poetry install | ||
poetry run pytest tests | ||
poetry run black --check --diff --line-length=88 slac tests | ||
env: | ||
TAG_VERSION: ${{ steps.context.outputs.TAG_VERSION }} | ||
PYPI_USER: ${{ secrets.PYPI_USER }} | ||
PYPI_PASS: ${{ secrets.PYPI_PASS }} |
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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