Update dependencies and migrate to Pydantic v2 #294
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: ci | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ main ] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update pip | |
run: python3 -m pip install --no-cache --upgrade pip setuptools wheel | |
- name: Install dependencies | |
run: pip3 install .[format] | |
- name: Check PEP8 with black | |
run: black . --check | |
build: | |
needs: format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update pip | |
run: python3 -m pip install --no-cache --upgrade pip pipx | |
- name: Build package | |
run: pipx run build --wheel | |
- uses: actions/upload-artifact@master | |
with: | |
name: package | |
path: ./dist | |
run_examples: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update pip | |
run: python3 -m pip install --no-cache --upgrade pip pipx | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@master | |
with: | |
name: package | |
path: ./dist | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.python}} | |
- name: Install package | |
run: python3 -m pip install dist/*.whl | |
- name: Run ReductStore | |
run: docker run -p 8383:8383 -d reduct/store:main | |
- name: Run examples | |
run: find examples/ -name *.py | xargs python3 | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11"] | |
reductstore_version: ["latest", "main"] | |
token: ["", "ACCESS_TOKEN"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@master | |
with: | |
name: package | |
path: ./dist | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{matrix.python}} | |
- name: Install package | |
run: python3 -m pip install dist/* | |
- name: Install dependencies | |
run: pip3 install .[test] | |
- name: Run ReductStore | |
run: docker run -p 8383:8383 -v ${PWD}/data:/data --env RS_API_TOKEN=${{matrix.token}} --env RS_LOG_LEVEL=DEBUG -d reduct/store:main | |
- name: Run Tests | |
run: PYTHONPATH=. RS_API_TOKEN=${{matrix.token}} pytest tests | |
- name: Dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
with: | |
dest: './logs' | |
- name: Tar logs | |
if: failure() | |
run: tar cvzf ./logs.tgz ./logs | |
- name: Upload logs to GitHub | |
if: failure() | |
uses: actions/upload-artifact@master | |
with: | |
name: logs.tgz | |
path: ./logs.tgz | |
pylint: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@master | |
with: | |
name: package | |
path: ./dist | |
- name: Upgrade pip | |
run: pip install -U pip | |
- name: Install package | |
run: python3 -m pip install dist/* | |
- name: Install dependencies | |
run: pip3 install .[test,lint] | |
- name: Lint main | |
run: pylint ./reduct | |
- name: Lint tests | |
run: pylint ./tests | |
py-pip-upload: | |
name: Upload if release | |
needs: [ pylint, test, run_examples ] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./python | |
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} | |
steps: | |
- uses: actions/setup-python@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: package | |
path: ./dist | |
- uses: pypa/[email protected] | |
with: | |
user: ${{ secrets.PYPI_USERNAME }} | |
password: ${{ secrets.PYPI_PASSWORD }} |