-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from JamesParrott/Synced_with_PyShp
Define test running in a reuseable action. Rename build.yml. Test before deployment. Only deploy from this repo, and only test on MacOS and Windows here..
- Loading branch information
Showing
4 changed files
with
119 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: | ||
Test | ||
|
||
description: | ||
Run pytest, and run the doctest runner (shapefile.py as a script). | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# The Repo is required to already be checked out, e.g. by the calling workflow | ||
|
||
# The Python to be tested with is required to already be setup, with "python" and "pip" on the system Path | ||
|
||
- name: Doctests | ||
shell: bash | ||
run: python shapefile.py | ||
|
||
- name: Install test dependencies. | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.test.txt | ||
- name: Pytest | ||
shell: bash | ||
run: | | ||
pytest | ||
- name: Show versions for logs. | ||
shell: bash | ||
run: | | ||
python --version | ||
python -m pytest --version |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# This workflow will run the pre-commit hooks (including linters), and the tests with a variety of Python versions | ||
|
||
name: Run pre-commit hooks and tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ master ] | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/[email protected] | ||
|
||
test_in_slim_Python_containers: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ | ||
"2.7", | ||
"3.5", | ||
"3.6", | ||
"3.7", | ||
"3.8", | ||
"3.9", | ||
"3.10", | ||
"3.11", | ||
"3.12", | ||
"3.13.0a2", | ||
] | ||
|
||
runs-on: ubuntu-latest | ||
container: | ||
image: python:${{ matrix.python-version }}-slim | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- 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-latest", | ||
"windows-latest", | ||
] | ||
# 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 |