Skip to content

Commit

Permalink
test: github actions for continues deployment to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe-Levin committed Jan 19, 2025
1 parent 689eb18 commit b0488d1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
67 changes: 67 additions & 0 deletions .github/workflows/py-client-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install

- 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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,7 @@ space2stats_api/space2stats_env
cdk.out
lambda_layer
.venv
.envrc
.envrc

# secrets
.secrets

0 comments on commit b0488d1

Please sign in to comment.