-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
7a075ca
commit 4bf54fa
Showing
3 changed files
with
71 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,42 @@ | ||
name: Python application | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install poetry | ||
run: | | ||
python -m pip install poetry | ||
- name: Configure poetry | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
- name: Cache the virtualenv | ||
uses: actions/cache@v2 | ||
with: | ||
path: ./.venv | ||
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Lint with ruff | ||
run: | | ||
poetry run ruff . | ||
- name: Run tests | ||
run: | | ||
poetry 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/python-poetry/poetry | ||
rev: '1.7.1' | ||
hooks: | ||
- id: poetry-check | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black | ||
language: system | ||
types: [python] | ||
- id: ruff | ||
name: ruff | ||
entry: poetry run ruff . --fix | ||
language: system | ||
types: [python] |
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,6 @@ | ||
from unittest import TestCase | ||
|
||
|
||
class TestHelloWorld(TestCase): | ||
def test_upper(self): | ||
self.assertEqual("hello world!".upper(), "HELLO WORLD!") |