diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml new file mode 100644 index 0000000..5ab5c88 --- /dev/null +++ b/.github/workflows/check_pr.yml @@ -0,0 +1,44 @@ +name: Check the source code +on: + pull_request: + branches: + - main +jobs: + Format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - run: pip install pipenv + - run: pipenv install --dev --skip-lock + - run: pipenv run black --check src/ && pipenv run isort --check src/ + - run: pipenv run black --check test/ && pipenv run isort --check test/ + Lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - run: pip install pipenv + - run: pipenv install --dev --skip-lock + - run: pipenv run flake8 src/ && pipenv run mypy src/ + - run: pipenv run flake8 test/ && pipenv run mypy test/ + Test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - run: pip install pipenv + - run: pipenv install --dev --skip-lock + - run: pipenv run pytest --cov=src test/