From 47d1c7fc33412207b7eba7a938c48fc244074408 Mon Sep 17 00:00:00 2001 From: hrimov Date: Mon, 15 Jan 2024 10:19:54 +0100 Subject: [PATCH] Add continuous integration workflow --- .github/workflows/lint-test.yml | 50 +++++++++++++++++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/lint-test.yml diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml new file mode 100644 index 0000000..2cbf61a --- /dev/null +++ b/.github/workflows/lint-test.yml @@ -0,0 +1,50 @@ +# Linters & tests running workflow + +name: Decision Making Application + +on: + + workflow_call: + + pull_request: + branches: [ master, dev, ] + push: + branches: [ master, dev, feature/continuous-integration, ] + +jobs: + lint: + needs: install-dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install poetry + run: pipx install poetry + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "poetry" + cache-dependency-path: poetry.lock + - name: Install dependencies + run: poetry install --only lint + - name: Lint with ruff + run: poetry run ruff check + - name: Lint with mypy + run: poetry run mypy . + test: + needs: install-dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install poetry + run: pipx install poetry + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "poetry" + cache-dependency-path: poetry.lock + - name: Install dependencies + run: poetry install --with test + - name: Test with pytest + run: poetry run pytest diff --git a/.gitignore b/.gitignore index 929b668..8678be6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .idea .python-version .DS_Store +.mypy_cache/ .pytest_cache/ +.ruff_cache/ __pycache__/ config/local.ini