diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87f5817..730e830 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ContinuousIntegration +name: CI/CD Workflow on: push: @@ -6,18 +6,15 @@ on: - "main" - "add_CI" pull_request: - branches: - - "main" - - "add_CI" + types: [opened, synchronize, reopened, ready_for_review] permissions: contents: read jobs: test: - + if: github.event_name == 'pull_request' runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Setup Python 3.8 @@ -29,10 +26,32 @@ jobs: with: python-version: 3.8.13 auto-activate-base: false - - name: Install and test shell: bash -l {0} run: | conda create -n test_env python=3.8.13 libgdal=3.5.2 -c conda-forge -c defaults -y conda activate test_env - echo "hello" + PIP_NO_BINARY=rasterio pip install . + pytest --compare + + deploy: + needs: test + if: github.ref == 'refs/heads/add_CI' && github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python 3.8 + uses: actions/setup-python@v3 + with: + python-version: "3.8.13" + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.8.13 + auto-activate-base: false + - name: Deploy to PyPI + shell: bash -l {0} + run: | + conda create -n deploy_env python=3.8.13 libgdal=3.5.2 build twine -c conda-forge -y + conda activate deploy_env + python -m build