1
- name : Unit Tests
1
+ name : Continuous Integration
2
+
2
3
on :
3
4
push :
4
5
branches :
8
9
- ' *'
9
10
schedule :
10
11
- cron : ' 59 23 * * *'
12
+ workflow_dispatch :
13
+ inputs :
14
+ version :
15
+ description : Manual CI Run
16
+ default : test
17
+ required : false
11
18
12
19
jobs :
13
- unittests :
14
- name : CI ( ${{ matrix.os }}- ${{ matrix.environment-file }})
20
+ tests :
21
+ name : ${{ matrix.os }}, ${{ matrix.environment-file }}
15
22
runs-on : ${{ matrix.os }}
16
- continue-on-error : false
17
- timeout-minutes : 45
23
+ timeout-minutes : 30
18
24
strategy :
19
25
matrix :
20
- os : [ubuntu-latest, macos-latest, windows-latest]
21
- environment-file : [ .ci/39.yml, .ci/310.yml, .ci/311.yml]
26
+ os : [ubuntu-latest]
27
+ environment-file : [
28
+ ci/310.yml,
29
+ ci/311.yml,
30
+ ci/312.yml,
31
+ ]
32
+ include :
33
+ - environment-file : ci/312.yml
34
+ os : macos-latest
35
+ - environment-file : ci/312.yml
36
+ os : macos-14 # Apple Silicon
37
+ - environment-file : ci/312.yml
38
+ os : windows-latest
22
39
fail-fast : false
23
40
41
+ defaults :
42
+ run :
43
+ shell : bash -l {0}
44
+
24
45
steps :
25
46
- name : checkout repo
26
- uses : actions/checkout@v2
47
+ uses : actions/checkout@v4
48
+ with :
49
+ fetch-depth : 0 # Fetch all history for all branches and tags.
27
50
28
51
- name : setup micromamba
29
- uses : mamba-org/provision-with- micromamba@main
52
+ uses : mamba-org/setup- micromamba@v1
30
53
with :
31
54
environment-file : ${{ matrix.environment-file }}
32
55
micromamba-version : ' latest'
33
-
34
- - name : reinstall tobler - bash
35
- shell : bash -l {0}
36
- run : pip install -e . --no-deps --force-reinstall
37
- if : matrix.os != 'windows-latest'
38
-
39
- - name : reinstall tobler - powershell
40
- shell : powershell
41
- run : pip install -e . --no-deps --force-reinstall
42
- if : matrix.os == 'windows-latest'
56
+
57
+ - name : environment info
58
+ run : |
59
+ micromamba info
60
+ micromamba list
43
61
44
- - name : run pytest - bash
45
- shell : bash -l {0}
46
- run : pytest -v tobler --cov=tobler --cov-report=xml
47
- if : matrix.os != 'windows-latest'
62
+ - name : spatial versions
63
+ run : ' python -c "import geopandas; geopandas.show_versions();"'
64
+
65
+ - name : install package
66
+ run : ' pip install . --no-deps'
48
67
49
- - name : run pytest - powershell
50
- shell : powershell
51
- run : pytest -v tobler --cov=tobler --cov-report=xml
52
- if : matrix.os == 'windows-latest'
68
+ - name : run tests
69
+ run : |
70
+ pytest tobler \
71
+ -v \
72
+ -r a \
73
+ -n auto \
74
+ --color yes \
75
+ --cov tobler \
76
+ --cov-append \
77
+ --cov-report term-missing \
78
+ --cov-report xml
53
79
54
80
- name : codecov
55
- uses : codecov/codecov-action@v1
81
+ uses : codecov/codecov-action@v3
56
82
with :
57
83
token : ${{ secrets.CODECOV_TOKEN }}
58
84
file : ./coverage.xml
59
85
name : tobler-codecov
86
+
87
+ - name : Generate and publish the report
88
+ if : |
89
+ failure()
90
+ && steps.status.outcome == 'failure'
91
+ && github.event_name == 'schedule'
92
+ && github.repository_owner == 'pysal'
93
+ uses : xarray-contrib/issue-from-pytest-log@v1
94
+ with :
95
+ log-path : pytest-log.jsonl
0 commit comments