-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub workflows: Added workflows push.yml and pull_request_to_main.yml
incl. sub-workflows _test.yml and _code_quality.yml
- Loading branch information
1 parent
5571a4d
commit 1e2e58e
Showing
4 changed files
with
130 additions
and
0 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,51 @@ | ||
name: Code Quality | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
black: | ||
name: black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: psf/black@stable | ||
with: | ||
options: '--check --diff' | ||
src: '.' | ||
jupyter: true | ||
version: '==23.11' | ||
|
||
ruff: | ||
runs-on: ubuntu-latest | ||
name: ruff | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' # cache pip dependencies | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Install ruff | ||
run: pip install ruff==0.1.6 | ||
- name: Run ruff | ||
run: ruff . | ||
|
||
pyright: | ||
runs-on: ubuntu-latest | ||
name: pyright | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' # cache pip dependencies | ||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
pip install pytest | ||
- name: Install pyright | ||
run: pip install pyright==1.1.336 | ||
- name: Run pyright | ||
run: pyright . |
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,33 @@ | ||
name: Unit Tests | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
test: | ||
name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: ubuntu-latest | ||
toxenv: linux | ||
- runner: windows-latest | ||
toxenv: windows | ||
python: | ||
- version: '3.9' | ||
toxenv: 'py39' | ||
- version: '3.10' | ||
toxenv: 'py310' | ||
- version: '3.11' | ||
toxenv: 'py311' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Python ${{ matrix.python.version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python.version }} | ||
cache: 'pip' # cache pip dependencies | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Run pytest | ||
run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}} |
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,28 @@ | ||
name: Pull Request to main | ||
run-name: Pull Request to main from ${{ github.event.pull_request.head.ref }} by @${{ github.actor }} | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
# - synchronize | ||
- reopened | ||
- ready_for_review | ||
- converted_to_draft | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: pr-${{ github.ref }}-1 | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code_quality: | ||
uses: ./.github/workflows/_code_quality.yml | ||
test: | ||
uses: ./.github/workflows/_test.yml | ||
# build_package: | ||
# needs: | ||
# - code_quality | ||
# - test | ||
# uses: ./.github/workflows/_build_package.yml |
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,18 @@ | ||
name: Push to custom branches | ||
run-name: Push to ${{ github.ref }} by @${{ github.actor }} | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
- release | ||
|
||
concurrency: | ||
group: push-${{ github.ref }}-1 | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code_quality: | ||
uses: ./.github/workflows/_code_quality.yml | ||
test: | ||
uses: ./.github/workflows/_test.yml |