Skip to content

Commit

Permalink
Run pytest tests as pull-request tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aseering committed Aug 16, 2023
1 parent b4727df commit 4cec6ce
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install gcloud
run: |
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg curl sudo
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update
sudo apt-get install google-cloud-cli google-cloud-cli-spanner-emulator
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[test,magic]'
- name: Test with pytest
run: |
python -m pytest
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ readme = "README.md"
[project.optional-dependencies]
test = [
"pytest",
"nbformat"
"nbformat",
"nbconvert",
"jupyter"
]
magic = [
"jupyter-client",
"ipython"
]

Expand Down

0 comments on commit 4cec6ce

Please sign in to comment.