File tree Expand file tree Collapse file tree 4 files changed +102
-17
lines changed Expand file tree Collapse file tree 4 files changed +102
-17
lines changed Original file line number Diff line number Diff line change
1
+ name :
2
+ Test
3
+
4
+ description :
5
+ Run pytest, and run the doctest runner (shapefile.py as a script).
6
+
7
+ runs :
8
+ using : " composite"
9
+ steps :
10
+ # The Repo is required to already be checked out, e.g. by the calling workflow
11
+
12
+ # The Python to be tested with is required to already be setup, with "python" and "pip" on the system Path
13
+
14
+ - name : Doctests
15
+ shell : bash
16
+ run : python shapefile.py
17
+
18
+ - name : Install test dependencies.
19
+ shell : bash
20
+ run : |
21
+ python -m pip install --upgrade pip
22
+ pip install -r requirements.test.txt
23
+
24
+ - name : Pytest
25
+ shell : bash
26
+ run : |
27
+ pytest
28
+
29
+ - name : Show versions for logs.
30
+ shell : bash
31
+ run : |
32
+ python --version
33
+ python -m pytest --version
Original file line number Diff line number Diff line change
1
+ # This workflow will run the tests on a variety of operating systems and architectures.
2
+
3
+ name : Run tests on low availability Github hosted runners
4
+
5
+ on :
6
+ # Optionally run only, until the availability of the required Github hosted
7
+ # runners does not slow down CI.
8
+ workflow_call :
9
+ workflow_dispatch :
10
+
11
+ jobs :
12
+ run_tests :
13
+ if : github.repository == 'GeospatialPython/pyshp'
14
+ strategy :
15
+ fail-fast : false
16
+ matrix :
17
+ python-version : [
18
+ " 3.12" ,
19
+ ]
20
+ os : [
21
+ # "macos-12",
22
+ " ubuntu-24.04" ,
23
+ # "windows-2022",
24
+ ]
25
+
26
+ runs-on : matrix.os
27
+ steps :
28
+ - uses : actions/checkout@v4
29
+
30
+ - uses : actions/setup-python@v5
31
+ with :
32
+ python-version : ${{ inputs.python_version }}
33
+
34
+ - name : Run tests
35
+ uses : ./.github/actions/test
Original file line number Diff line number Diff line change 13
13
types : [published]
14
14
15
15
jobs :
16
- deploy :
16
+ test :
17
17
18
+ # In general, tests should be run after building a distribution, to test that distribution.
19
+ # However as long as PyShp is a pure Python library, with pure Python deps (or no deps)
20
+ # then this would only test the packaging process, not so much the code as there are
21
+ # no binaries.
18
22
runs-on : ubuntu-latest
19
23
20
24
steps :
21
25
- uses : actions/checkout@v4
22
26
- name : Set up Python
23
- uses : actions/setup-python@v2
27
+ uses : actions/setup-python@v5
24
28
with :
25
29
python-version : ' 3.x'
30
+
31
+ - name : Run tests and hooks
32
+ uses : ./.github/workflows/run_tests_and_hooks.yml
33
+
34
+ deploy :
35
+ # Prevent deployment of releases that fail any hooks (e.g. linting) or that fail any tests.
36
+ needs : test
37
+ runs-on : ubuntu-latest
38
+
39
+ steps :
40
+ - uses : actions/checkout@v4
41
+ - name : Set up Python
42
+ uses : actions/setup-python@v5
43
+ with :
44
+ python-version : ' 3.x'
45
+
46
+
47
+
26
48
- name : Install dependencies
27
49
run : |
28
50
python -m pip install --upgrade pip
29
51
pip install build
30
52
- name : Build package
31
53
run : python -m build
54
+
32
55
- name : Publish package
56
+ if : github.repository == 'GeospatialPython/pyshp'
33
57
uses : pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34
58
with :
35
59
user : __token__
Original file line number Diff line number Diff line change 1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1
+ # This workflow will run the pre-commit hooks (including linters), and the tests with a variety of Python versions
3
2
4
- name : build
3
+ name : Run pre-commit hooks and tests
5
4
6
5
on :
7
6
push :
8
7
pull_request :
9
8
branches : [ master ]
9
+ workflow_call :
10
10
workflow_dispatch :
11
11
12
12
jobs :
16
16
- uses : actions/checkout@v4
17
17
- uses : actions/setup-python@v5
18
18
- uses : pre-commit/action@v3.0.1
19
- test :
20
19
20
+ run_tests_in_containers :
21
21
strategy :
22
22
fail-fast : false
23
23
matrix :
40
40
41
41
steps :
42
42
- uses : actions/checkout@v4
43
- - name : Install dependencies
44
- run : |
45
- python -m pip install --upgrade pip
46
- python -m pip install pytest
47
- if [ -f requirements.test.txt ]; then pip install -r requirements.test.txt; fi
48
- - name : Test with doctest
49
- run : |
50
- python shapefile.py
51
- - name : Test with pytest
52
- run : |
53
- pytest
43
+
44
+ - name : Run tests
45
+ uses : ./.github/actions/test
46
+
You can’t perform that action at this time.
0 commit comments