-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
5 changed files
with
1,487 additions
and
0 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,6 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
select = C,E,F,W,B,B950 | ||
ignore = E203, E501, W503 | ||
exclude = *tests/*, *old_graph* | ||
per-file-ignores = __init__.py:F401 |
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,26 @@ | ||
name: release-version | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- uses: Gr1N/setup-poetry@v4 | ||
- name: Build package | ||
run: | | ||
export RELEASE_VERSION="${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
poetry version ${RELEASE_VERSION} | ||
poetry build | ||
- name: Upload package | ||
run: | | ||
RELEASE_VERSION="${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
echo ${{secrets.GITHUB_TOKEN}} | gh auth login --with-token | ||
gh release upload --clobber ${RELEASE_VERSION} ./dist/*.tar.gz ./dist/*.whl | ||
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,76 @@ | ||
name: on-pull-request | ||
on: [workflow_dispatch,pull_request] | ||
jobs: | ||
build-n-test: | ||
env: | ||
POETRY_CACHE_FOLDER: '/home/runner/.cache/pypoetry/virtualenvs' | ||
JUNIT_REPORT_PATH: pytest-junit-report | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- uses: Gr1N/setup-poetry@v4 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ env.POETRY_CACHE_FOLDER }} | ||
key: poetry-pr-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | ||
- run: poetry install | ||
- id: back-check | ||
run: poetry run black --check . | ||
continue-on-error: true | ||
- id: flake8 | ||
run: poetry run flake8 | ||
continue-on-error: true | ||
- id: pytest | ||
run: | | ||
[ -d pytest-cov-report ] || mkdir -p pytest-cov-report | ||
[ -d ${JUNIT_REPORT_PATH} ] || mkdir -p ${JUNIT_REPORT_PATH} | ||
poetry run pytest --junitxml=${JUNIT_REPORT_PATH}/report.xml --cov=pytest-cov-report --cov-report=xml | ||
continue-on-error: true | ||
- id: collect-pytest-reports | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-report | ||
path: pytest-junit-report | ||
- id: collect-pytest-cov-reports | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-cov-report | ||
path: pytest-cov-report | ||
- name: Display JUnit results | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
with: | ||
files: ${{env.JUNIT_REPORT_PATH}}/*.xml | ||
- name: check tests results | ||
run: | | ||
TEST_FAILED=0 | ||
if [ ${{steps.back-check.outcome}} != 'success' ]; then | ||
echo "black failed, result was: ${{steps.back-check.outcome}}" | ||
TEST_FAILED=1 | ||
else | ||
echo "black passed" | ||
fi | ||
if [ ${{steps.flake8.outcome}} != 'success' ]; then | ||
echo "flake8 failed, result was: ${{steps.flake8.outcome}}" | ||
TEST_FAILED=1 | ||
else | ||
echo "flake8 passed" | ||
fi | ||
if [ ${{steps.pytest.outcome}} != 'success' ]; then | ||
echo "pytest failed, result was: ${{steps.pytest.outcome}}" | ||
TEST_FAILED=1 | ||
else | ||
echo "pytest passed" | ||
fi | ||
if [ ${TEST_FAILED} -ne 0 ]; then | ||
exit 1 | ||
fi | ||
Oops, something went wrong.