-
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.
Minimal GitHub CI: demo unittest and black check (#142)
* setup minimal Gitlab CI: unittest, black only for the main branch and PRs to the main pytest are only demo tests * apply the same behavior for CI for the release-1.0.0 branch as for the main
- Loading branch information
Showing
5 changed files
with
68 additions
and
2 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,26 @@ | ||
name: Black Check | ||
|
||
on: | ||
push: | ||
branches: [ main, release-1.0.0] | ||
pull_request: | ||
branches: [ main, release-1.0.0] | ||
|
||
jobs: | ||
|
||
check-black: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install Black 24.10.0 - check setup.py if version matches | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install black==24.10.0 | ||
- name: Run Black | ||
run: | | ||
black --check . --line-length 120 |
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,26 @@ | ||
name: Pytest | ||
|
||
on: | ||
push: | ||
branches: [ main, release-1.0.0] | ||
pull_request: | ||
branches: [ main, release-1.0.0] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[test] | ||
- name: Run tests | ||
run: | | ||
pytest |
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 |
---|---|---|
|
@@ -314,4 +314,4 @@ def run(): | |
|
||
if __name__ == "__main__": | ||
app = create_app() | ||
app.run(debug=False) | ||
app.run(debug=False) |
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
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,11 @@ | ||
def test_demo_ok(): | ||
assert 1 + 1 == 2 | ||
|
||
|
||
# # Uncomment to fail the tests | ||
# def test_demo_ko(): | ||
# assert 1 + 1 == 3 | ||
# | ||
# | ||
# def test_demo_exception(): | ||
# return 1 / 0 |