[IMP] add new lint: no-raise-unlink #258
Workflow file for this run
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
name: build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.7', '3.8', '3.9', '3.10', '3.11'] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
tox_env: [py] | |
include: | |
- python: '3.10' | |
os: ubuntu-latest | |
tox_env: py,lint,update-readme,build | |
exclude: | |
- python: '3.7' | |
os: windows-latest | |
steps: | |
- name: Set git to not change EoL | |
if: runner.os == 'Windows' | |
run: | | |
git config --global core.autocrlf false | |
- name: Cache pre-commit packages | |
id: cache-pre-commit | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-py${{ matrix.python }}-pre-commit | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
architecture: 'x64' | |
cache: 'pip' | |
- name: install dependencies | |
run: | | |
python -mpip install --progress-bar=off -r test-requirements.txt | |
pip --version | |
pip list --format=freeze | |
- name: Test | |
run: tox -e ${{ matrix.tox_env }} -v | |
# TODO: Publish package only for signed tags | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && contains(matrix.tox_env, 'build') | |
run: | | |
ls -lah dist/* | |
python -m twine upload --verbose -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --repository-url https://upload.pypi.org/legacy/ dist/* | |
# TODO: Add GITHUB_RUN_ID.GITHUB_RUN_ATTEMPT.GITHUB_RUN_NUMBER to bumpversion to avoid duplicating upload versions or even the git sha | |
# For now, feel free to uncomment this line of code to test things related to upload to pypi (test) | |
# - name: TestPyPI publish package | |
# if: runner.os == 'Linux' && startsWith(matrix.tox_env, 'py39-cover') | |
# run: >- | |
# python -m twine upload --verbose -u __token__ -p ${{ secrets.PYPI_TEST_API_TOKEN }} \ | |
# --repository-url https://test.pypi.org/legacy/ dist/* || true | |
- name: codecov | |
if: startsWith(matrix.tox_env, 'py') # only coveralls in python tests | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: false # TODO: Set true after fix token for win&macosx | |
verbose: true |