Skip to content

release v1.12

release v1.12 #415

Workflow file for this run

name: ci
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
- 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@v4
- name: Update pip
run: python3 -m pip install --no-cache --upgrade pip pipx
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: package
path: ./dist
- uses: actions/setup-python@v5
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: Sleep
run: sleep 5
- 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"]
reductstore_version: ["latest", "main"]
token: ["", "ACCESS_TOKEN"]
license: ["", "/workdir/lic.key"]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@master
with:
name: package
path: ./dist
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: Install package
run: python3 -m pip install dist/*
- name: Install dependencies
run: pip3 install .[test]
- name: Generate license
run: echo '${{secrets.LICENSE_KEY}}' > lic.key
- name: Run ReductStore
run: docker run -p 8383:8383 -v ${PWD}:/workdir
--env RS_API_TOKEN=${{matrix.token}}
--env RS_LOG_LEVEL=DEBUG
--env RS_LICENSE_PATH=${{matrix.license}}
-d reduct/store:${{matrix.reductstore_version}}
- name: Run Tests
run: PYTHONPATH=. RS_API_TOKEN=${{matrix.token}} RS_LICENSE_PATH=${{matrix.license}} 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@v4
- 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@v3
- uses: actions/download-artifact@master
with:
name: package
path: ./dist
- uses: pypa/[email protected]
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}