added warning and doc changes #69
This file contains hidden or 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
name: Lint, format, and test | |
on: | |
pull_request: | |
types: [labeled, opened, synchronize, reopened] | |
branches: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Run tests, linting, and formatting | |
runs-on: ubuntu-latest | |
env: | |
ROLE_ARN: ${{ secrets.ROLE_ARN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
virtualenvs-path: .venv | |
installer-parallel: true | |
- name: Cache Poetry dependencies | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock', '**/pyproject.toml') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root --all-groups | |
- name: Install project | |
run: poetry install --no-interaction --all-groups | |
- name: Check formatting with Black | |
uses: psf/black@stable | |
with: | |
options: ". --check" | |
- name: Lint with Flake8 | |
uses: reviewdog/action-flake8@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run unit tests | |
run: | | |
source .venv/bin/activate | |
pytest tests/ -v |