diff --git a/.github/workflows/deploy.yml b/.github/workflows/test-and-deploy.yml similarity index 77% rename from .github/workflows/deploy.yml rename to .github/workflows/test-and-deploy.yml index 3006c11f..d75d763e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -1,8 +1,10 @@ -name: "Deploy Python Lib" +name: "Test Python Lib" on: - release: - types: - - created + push: + branches: + - main + - devel + - deploy pull_request: permissions: @@ -10,6 +12,35 @@ permissions: pull-requests: read jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python: ['3.9', '3.10', '3.11', '3.12'] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + pip install setuptools + pip install matplotlib + pip install pytest + + - name: Install lib + run: | + python setup.py develop + + - name: pytest + run: | + pytest GPy/testing + build-windows: strategy: matrix: @@ -124,7 +155,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: [build-linux, build-windows, build-mac] + needs: [test, build-linux, build-windows, build-mac] steps: - name: Checkout uses: actions/checkout@v4 @@ -138,7 +169,7 @@ jobs: run: | pip install --upgrade pip pip install twine - + - name: Download all artifacts to a specific directory uses: actions/download-artifact@v3 with: @@ -148,8 +179,8 @@ jobs: run: | ls -R dist - # - name: Upload to PyPI using twine - # run: twine upload --skip-existing wheelhouse/* - # env: - # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Upload to PyPI using twine + run: twine upload --skip-existing wheelhouse/* + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index c4a906ef..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: "Test Python Lib" -on: - push: - branches: - - main - - devel - - deploy - pull_request: - -permissions: - contents: read - pull-requests: read - -jobs: - develop-matrix: - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python: ['3.9', '3.10', '3.11', '3.12'] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies - run: | - pip install setuptools - pip install matplotlib - pip install pytest - - - name: Install lib - run: | - python setup.py develop - - - name: pytest - run: | - pytest GPy/testing