build: Convert build to pyproject #83
Workflow file for this run
This file contains 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: chimedb_dataflag-ci-build | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
lint-code: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.12 | |
- name: Install black | |
run: pip install black | |
- name: Check code with black | |
run: black --check . | |
run-tests: | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.12"] | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.4 | |
env: | |
MYSQL_USER: test | |
MYSQL_PASSWORD: test | |
MYSQL_DATABASE: test | |
MYSQL_ROOT_PASSWORD: test | |
ports: | |
- 32574:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install apt dependencies | |
run: | | |
sudo apt-get install -y libopenmpi-dev libhdf5-serial-dev | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install chimedb_dataflags | |
run: | | |
pip install . | |
- name: Install test requirements | |
run: | | |
pip install .[test] | |
- name: Run tests | |
# Set PYTHONPATH so that relative imports in click script work when pytest imports that | |
run: PYTHONPATH=. pytest -s tests |