[WIP] space2stats-client #2
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: Client CI/CD | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'space2stats_client/**' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'space2stats_client/**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./space2stats_client | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
proj-bin libproj-dev gdal-bin libgdal-dev build-essential python3-dev \ | |
libgeos-dev libopenblas-dev liblapack-dev libatlas-base-dev libhdf5-dev | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: | | |
poetry run pip install --upgrade pip setuptools wheel | |
poetry run pip install cython numpy | |
poetry install --no-root | |
- name: Run tests | |
run: poetry run pytest | |
publish: | |
needs: test | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./space2stats_client | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Build and publish | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry build | |
poetry publish |