diff --git a/.ci/requirements.txt b/.ci/requirements.txt new file mode 100644 index 0000000..b5cd516 --- /dev/null +++ b/.ci/requirements.txt @@ -0,0 +1,4 @@ +pip +wheel +pytest +typer diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78bb58d..a855270 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,13 +2,16 @@ name: build on: [push, pull_request] + jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.7", "3.9"] - + env: + # cache busting if requirements haven't changed + CACHE_EPOCH: 0 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -23,7 +26,7 @@ jobs: uses: actions/cache@v2.1.7 with: path: .venv - key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + key: venv-${{ env.CACHE_EPOCH }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} - name: Install dependencies run: | poetry config virtualenvs.in-project true @@ -40,3 +43,8 @@ jobs: - name: Run safety checks run: | make check-safety + + - name: Check self requirements + run: | + poetry run pip install -r requirements.txt + poetry run check_reqs requirements.txt diff --git a/.github/workflows/git_checks.yml b/.github/workflows/git_checks.yml new file mode 100644 index 0000000..6b1aaad --- /dev/null +++ b/.github/workflows/git_checks.yml @@ -0,0 +1,23 @@ +on: pull_request + +name: Git + +jobs: + message-check: + name: Block Autosquash Commits + runs-on: ubuntu-latest + steps: + - name: Block Autosquash Commits + uses: xt0rted/block-autosquash-commits-action@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + merge_conflict_job: + runs-on: ubuntu-latest + name: Find merge conflicts + steps: + # Checkout the source code so we have some files to look at. + - uses: actions/checkout@v2 + # Run the actual merge conflict finder + - name: Merge Conflict finder + uses: olivernybroe/action-conflict-finder@v2.0 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index f55b27f..0c06b2b 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -4,7 +4,7 @@ on: push: # branches to consider in the event; optional, defaults to all branches: - - master + - main jobs: update_release_draft: diff --git a/assets/images/coverage.svg b/assets/images/coverage.svg index 0644a48..e123fe5 100644 --- a/assets/images/coverage.svg +++ b/assets/images/coverage.svg @@ -15,7 +15,7 @@ coverage coverage - 26% - 26% + 9% + 9% diff --git a/check_reqs/__main__.py b/check_reqs/__main__.py index 4f00639..f467cdc 100644 --- a/check_reqs/__main__.py +++ b/check_reqs/__main__.py @@ -1,7 +1,6 @@ # type: ignore[attr-defined] from enum import Enum from pathlib import Path -from random import choice import typer from rich.console import Console diff --git a/tests/test_example/test_hello.py b/tests/test_example/test_hello.py deleted file mode 100644 index 31ac38d..0000000 --- a/tests/test_example/test_hello.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Tests for hello function.""" -import pytest - -from check_reqs.example import hello - - -@pytest.mark.parametrize( - ("name", "expected"), - [ - ("Jeanette", "Hello Jeanette!"), - ("Raven", "Hello Raven!"), - ("Maxine", "Hello Maxine!"), - ("Matteo", "Hello Matteo!"), - ("Destinee", "Hello Destinee!"), - ("Alden", "Hello Alden!"), - ("Mariah", "Hello Mariah!"), - ("Anika", "Hello Anika!"), - ("Isabella", "Hello Isabella!"), - ], -) -def test_hello(name, expected): - """Example test with parametrization.""" - assert hello(name) == expected diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 0000000..f40e4b2 --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,4 @@ +def test_version(): + import check_reqs as cr + + assert cr.get_version()