-
Notifications
You must be signed in to change notification settings - Fork 24
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
3 changed files
with
79 additions
and
34 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,77 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
tags: [v*] | ||
pull_request: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: Install check-wheel-content, pre-commit, and twine | ||
run: python -m pip install build pre-commit check-wheel-contents twine | ||
- name: Build package | ||
run: python -m build | ||
- name: Run linter | ||
run: python -m pre_commit run --all-files --show-diff-on-failure | ||
- name: Check wheel contents | ||
run: check-wheel-contents dist/*.whl | ||
- name: Check by twine | ||
run: python -m twine check dist/* | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python ${{ matrix.python-version }} dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Run pytest | ||
run: pytest | ||
|
||
|
||
deploy: | ||
name: Deploy | ||
environment: release | ||
# Run only on pushing a tag | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
needs: [lint, test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Install build | ||
run: python -m pip install build pre-commit check-wheel-contents twine | ||
- name: Build package | ||
run: python -m build | ||
- name: PyPI upload | ||
uses: pypa/[email protected] | ||
with: | ||
packages_dir: dist | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: pytest-aiohttp ${{ github.ref_name }} | ||
artifacts: dist/* | ||
bodyFile: README.rst | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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