-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Keep `release-please` action in a separate workflow - Cache python env according to platform, python path (exact version) and `pyproject.toml` hash for fast CI - Run `flakehell` and `black` (check-only) on pushes/PRs to ensure consistent codestyle - Run `pytest` on pushes/PR on a matrix of python versions and platforms - Upload code coverage to Codecov on pushes/PR - For draft PRs, tests & checks are skipped - Run `flit publish` on release to build and publish package (token stored as gh secret) Closes #7 Co-authored-by: Mestery <mestery@pm.me>
- Loading branch information
1 parent
99ddfaf
commit 39281be
Showing
6 changed files
with
130 additions
and
4 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,36 @@ | ||
name: CD - Publish package | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
publish: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Cache python env | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: Install deps | ||
env: | ||
PIP_UPGRADE: True | ||
UPGRADE_STRATEGY: eager | ||
run: | | ||
python -m pip install pip flit | ||
python -m flit install --deps develop | ||
- name: Build and publish with Flit | ||
env: | ||
FLIT_USERNAME: __token__ | ||
FLIT_PASSWORD: ${{ secrets.FLIT_TOKEN }} | ||
run: python -m flit publish |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: CD - Release package | ||
name: CD - Release Please | ||
|
||
on: | ||
push: | ||
|
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,80 @@ | ||
name: CI - Test package | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.draft == false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Cache python env | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: Install deps | ||
env: | ||
PIP_UPGRADE: True | ||
UPGRADE_STRATEGY: eager | ||
run: | | ||
python -m pip install pip flit | ||
python -m flit install --deps develop | ||
- name: Check format with black | ||
run: python -m black -v --check . | ||
- name: Lint with flakehell | ||
run: python -m flakehell lint -v | ||
|
||
test: | ||
name: Tests | ||
needs: lint | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
_OS: ${{ matrix.os }} | ||
_PY: ${{ matrix.python-version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache python env | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: Install deps | ||
env: | ||
PIP_UPGRADE: True | ||
UPGRADE_STRATEGY: eager | ||
run: | | ||
python -m pip install pip flit | ||
python -m flit install --deps develop | ||
- name: Run tests with pytest | ||
run: pytest -v --cov=incipyt --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
fail_ci_if_error: true | ||
env_vars: _OS,_PY |
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
Empty file.
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,5 @@ | ||
import incipyt # noqa: F401 | ||
|
||
|
||
def test_dummy(): | ||
assert True |