Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add GitHub action for testing the latest package version released on PyPi #560

Merged
merged 18 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading