Skip to content

[.github] - chore: add tests in PR CI #5

[.github] - chore: add tests in PR CI

[.github] - chore: add tests in PR CI #5

Workflow file for this run

name: CI
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "poetry"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-dev-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-dev-
- name: Install dev dependencies
run: poetry install --only dev
- name: Check formatting
run: poetry run task check-formatting
- name: Run lint
run: poetry run task lint
- name: Run type checking
run: poetry run mypy bert_squeeze
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "poetry"
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-all-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-all-
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run task test