WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

deploy: replace unmaintained action #62

deploy: replace unmaintained action

deploy: replace unmaintained action #62

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
check:
if: github.event_name != 'push' || github.ref != 'refs/heads/devel'
runs-on: ubuntu-latest
name: check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: set PYSHA
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: dependencies
run: pip install -U pre-commit
- uses: reviewdog/action-setup@v1
- if: github.event_name != 'schedule'
name: comment
run: |
if [[ $EVENT == pull_request ]]; then
REPORTER=github-pr-review
else
REPORTER=github-check
fi
pre-commit run -a todo | reviewdog -efm="%f:%l: %m" -name=TODO -tee -reporter=$REPORTER -filter-mode nofilter
pre-commit run -a flake8 | reviewdog -f=pep8 -name=flake8 -tee -reporter=$REPORTER -filter-mode nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event_name }}
- run: pre-commit run -a --show-diff-on-failure
test:
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
runs-on: [self-hosted, cuda, python]
strategy:
matrix:
python: [3.6, 3.9]
name: py${{ matrix.python }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run setup-python
run: setup-python -p${{ matrix.python }} tensorflow-gpu
- run: pip install -U -e .[dev]
- run: pytest
- run: codecov
- name: Post Run setup-python
run: setup-python -p${{ matrix.python }} -Dr
if: ${{ always() }}
deploy:
needs: [check, test]
name: PyPI Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
pip: true
password: ${{ secrets.PYPI_TOKEN }}
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
- name: Changelog
run: git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
release_name: NiftyML ${{ github.ref }} beta
body_path: _CHANGES.md
draft: true
files: dist/${{ steps.dist.outputs.whl }}