-
Notifications
You must be signed in to change notification settings - Fork 14
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
8 changed files
with
153 additions
and
55 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,109 @@ | ||
name: Python package | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.6 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.6 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: pipenv install --dev --python 3.6 | ||
- name: generate code | ||
run: pipenv run python local_gen.py | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: generated-ldraw-library | ||
path: ldraw/library | ||
|
||
test: | ||
needs: generate | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: pipenv install --dev --python ${{ matrix.python-version }} | ||
|
||
- uses: actions/download-artifact@master | ||
with: | ||
name: generated-ldraw-library | ||
path: ldraw/library | ||
|
||
- name: install for test | ||
run: | | ||
pipenv install --dev | ||
pipenv run pip freeze | ||
- name: Test with pytest | ||
run: pipenv run pytest --cov=ldraw | ||
- name: Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.coveralls_repo_token }} | ||
run: pipenv run coveralls | ||
|
||
publish: | ||
needs: | ||
- test | ||
- generate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.6 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.6 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: pipenv --python 3.6 install --dev | ||
|
||
- uses: actions/download-artifact@master | ||
with: | ||
name: generated-ldraw-library | ||
path: ldraw/library | ||
|
||
- name: Build package | ||
run: | | ||
pipenv run python setup.py sdist bdist_wheel | ||
- name: Twine check | ||
run: pipenv run twine check dist/* | ||
- name: test upload | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.testpypi_password }} | ||
run: | | ||
pipenv run twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
- name: Publish package | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.pypi_password }} | ||
run: | | ||
pipenv run twine upload dist/* | ||
cleanup_job: | ||
needs: publish | ||
if: always() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: call webhook to delete artifacts | ||
env: | ||
FOR_WEBHOOKS_SECRET: ${{ secrets.FOR_WEBHOOKS_SECRET }} | ||
run: | | ||
echo "::add-mask::$FOR_WEBHOOKS_SECRET" | ||
curl --verbose --fail --show-error --location --request POST "https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches" --header "Authorization: token $FOR_WEBHOOKS_SECRET" --header 'Content-Type: application/json' --header 'Accept: application/vnd.github.everest-preview+json' --data-raw "{ \"event_type\": \"delete_all_artifacts\", \"client_payload\": {\"parent_runid\": \"$GITHUB_RUN_ID\", \"parent_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: delete calling job's artifacts | ||
on: repository_dispatch | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete artifacts | ||
if: github.event.action == 'delete_all_artifacts' | ||
uses: christian-korneck/delete-run-artifacts-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
parent_runid: ${{ github.event.client_payload.parent_runid }} | ||
parent_repo: ${{ github.event.client_payload.parent_repo }} |
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 |
---|---|---|
|
@@ -8,5 +8,5 @@ tmp/ | |
\.tox | ||
tmp/ | ||
ldraw/library/ | ||
|
||
dist/ | ||
Pipfile.lock |
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,26 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
pycodestyle = "*" | ||
pytest = "*" | ||
coveralls = "*" | ||
pytest-cov = "*" | ||
mock = "*" | ||
setuptools-scm = "*" | ||
twine = "*" | ||
|
||
[packages] | ||
appdirs = "*" | ||
numpy = "*" | ||
pymklist = "*" | ||
pystache = "*" | ||
attrdict = "*" | ||
progress = "*" | ||
PyYAML = "*" | ||
Pillow = "*" | ||
|
||
[pipenv] | ||
allow_prereleases = 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
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 |
---|---|---|
|
@@ -4,5 +4,4 @@ coveralls | |
pytest-cov | ||
mock | ||
setuptools_scm | ||
tox | ||
ipdb | ||
twine |