Skip to content

Commit

Permalink
Merge pull request #560 from DeepRank/539_action_for_testing_release_…
Browse files Browse the repository at this point in the history
…gcroci2

ci: add GitHub action for testing the latest package version released on PyPi
  • Loading branch information
gcroci2 authored Jan 25, 2024
2 parents 8718308 + 6d0ca44 commit 67ce748
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/actions/install-python-and-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ inputs:
description: "The extras dependencies packages to be installed, for instance 'dev' or 'dev,publishing,notebooks'."
default: "test"

pkg-installation-type:
required: false
description: "The package installation type to install, the latest released version on PyPI ('latest') or the GitHub repository one ('repository')."
default: "repository"

runs:
using: "composite"

Expand Down Expand Up @@ -77,6 +82,14 @@ runs:
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-$(python3 -c "import torch; print(torch.__version__)")+cpu.html
# PyTables via conda only for MacOS
conda install pytables
- name: Install the package
- name: Install the GitHub repository version of the package
shell: bash {0}
if: ${{ inputs.pkg-installation-type == 'repository' }}
run: pip install .'[${{ inputs.extras-require }}]'
- name: Install the latest released version of the package
shell: bash {0}
if: ${{ inputs.pkg-installation-type == 'latest' }}
run: |
pip install pytest
rm -r deeprank2
pip install deeprank2
28 changes: 28 additions & 0 deletions .github/workflows/build-latest-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build (latest release)

# Only trigger, when the release workflow succeeded
on:
workflow_run:
workflows: ["Build and upload to PyPI"]
types:
- completed

jobs:
build:
name: Build for (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"] # ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-python-and-package
with:
python-version: ${{ matrix.python-version }}
pkg-installation-type: "latest"
- name: Run unit tests
run: pytest -v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: build (repository package)

on:
push:
Expand Down Expand Up @@ -45,6 +45,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
extras-require: test, publishing
pkg-installation-type: "repository"
- name: Run unit tests
run: pytest -v
- name: Verify that we can build the package
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
extras-require: publishing
pkg-installation-type: "repository"
- name: Build wheel and source distribution
run: python -m build
- uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 67ce748

Please sign in to comment.