Skip to content

Commit

Permalink
Re-use and re-instate the Action file
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesParrott committed Sep 17, 2024
1 parent 6b62dc6 commit 658f30c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 36 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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
run: python shapefile.py

- name: Install test dependencies.
run: |
python -m pip install --upgrade pip
pip install -r requirements.test.txt
- name: Pytest
run: |
pytest
- name: Show versions for logs.
run: |
python --version
python -m pytest --version
40 changes: 4 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,11 @@ jobs:
steps:
- uses: actions/checkout@v4


- name: Doctests
run: python shapefile.py

- name: Install test dependencies.
run: |
python -m pip install --upgrade pip
pip install -r requirements.test.txt
- name: Pytest
run: |
pytest
- name: Show versions for logs.
run: |
python --version
python -m pytest --version
- name: Run tests
uses: ./.github/actions/test


test_on_MacOS_and_Windows:

strategy:
fail-fast: false
matrix:
Expand All @@ -71,14 +55,12 @@ jobs:
"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
Expand All @@ -87,19 +69,5 @@ jobs:
with:
python-version: ${{ inputs.python_version }}

- name: Doctests
run: python shapefile.py

- name: Install test dependencies.
run: |
python -m pip install --upgrade pip
pip install -r requirements.test.txt
- name: Pytest
run: |
pytest
- name: Show versions for logs.
run: |
python --version
python -m pytest --version
- name: Run tests
uses: ./.github/actions/test

0 comments on commit 658f30c

Please sign in to comment.