Skip to content

Commit

Permalink
Make testing on MacOS, Windows and Ubuntu 24.04 runners optional
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesParrott committed Sep 17, 2024
1 parent a0c458c commit be71d04
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 38 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cross_platform_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will run the tests on a variety of operating systems and architectures.

name: Run tests on low availability Github osted runners

on:
# Optionally run only, until the availability of the required Github hosted
# runners does not slow down CI.
workflow_call:
workflow_dispatch:

jobs:
run_tests:
if: github.repository == 'GeospatialPython/pyshp'
strategy:
fail-fast: false
matrix:
python-version: [
"3.12",
]
os: [
# "macos-12",
"ubuntu-24.04",
# "windows-2022",
]

runs-on: matrix.os
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Run tests
uses: ./.github/actions/test
27 changes: 20 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,38 @@ on:
types: [published]

jobs:
deploy:
test:

# In general, tests should be run after building a distribution, to test that distribution.
# However as long as PyShp is a pure Python library, with pure Python deps (or no deps)
# then this would only test the packaging process, not so much the code as there are
# no binaries.
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

# In general tests should be run after building a distribution, to test that distribution.
# However as long as PyShp is a pure Python library, with pure Python deps (or no deps)
# then it's not crucial.

# Prevent deployment of releases that fail any hooks (e.g. linting) or that fail any tests.
- name: Run tests and hooks
uses: ./.github/workflows/run_tests_and_hooks.yml

deploy:
# Prevent deployment of releases that fail any hooks (e.g. linting) or that fail any tests.
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'



- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
32 changes: 1 addition & 31 deletions .github/workflows/run_tests_and_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1

test_in_slim_Python_containers:
run_tests_in_containers:
strategy:
fail-fast: false
matrix:
Expand All @@ -44,33 +44,3 @@ jobs:
- name: Run tests
uses: ./.github/actions/test


test_on_MacOS_and_Windows:
if: github.repository == 'GeospatialPython/pyshp'
strategy:
fail-fast: false
matrix:
python-version: [
"3.12",
]
os: [
# "macos-12",
"ubuntu-24.04",
"windows-2022",
]
# include:
# - os: "windows-latest"
# python-version: "3.13"
# - os: "macos-latest"
# python-version: "3.13"

runs-on: matrix.os
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Run tests
uses: ./.github/actions/test

0 comments on commit be71d04

Please sign in to comment.