Skip to content

Commit

Permalink
ci: add gh actions unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hrz6976 committed Jun 5, 2024
1 parent 7895374 commit d52ae94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
File renamed without changes.
38 changes: 20 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,35 @@ on: [push, pull_request]
jobs:
test:
name: Python ${{ matrix.python-version }} tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.6, 3.8]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Install Poetry
run: |
PIPX_BIN_DIR=/usr/local/bin pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: poetry.lock

- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set Poetry environment
run: |
poetry env use ${{ matrix.python-version }}
- name: Install dependencies (Python ${{ matrix.python-version }})
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install typing cython setuptools>=18.0
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
poetry install
- name: Run tests on Python ${{ matrix.python-version }}
run: make test_local
- name: Run tests
run: |
poetry run pytest -v

0 comments on commit d52ae94

Please sign in to comment.