-
Notifications
You must be signed in to change notification settings - Fork 219
104 lines (96 loc) · 3.05 KB
/
ci_tests_legacy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Test PyGMT with GMT legacy versions on Linux/macOS/Windows
#
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the
# minor baseline image changes between GMT versions, the workflow only runs
# the tests but doesn't do image comparisons.
#
# It is scheduled to run every Tuesday on the main branch.
#
name: GMT Legacy Tests
on:
# push:
# branches: [ main ]
# Uncomment the 'pull_request' line below to trigger the workflow in PR
# pull_request:
# types: [ready_for_review]
# paths:
# - 'pygmt/**'
# - '.github/workflows/ci_tests_legacy.yaml'
workflow_dispatch:
# Schedule tests on Tuesday
schedule:
- cron: '0 0 * * 2'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }}
runs-on: ${{ matrix.os }}
if: github.repository == 'GenericMappingTools/pygmt'
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-12, windows-2019]
gmt_version: ['6.3', '6.4']
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/[email protected]
with:
environment-name: pygmt
condarc: |
channels:
- conda-forge
- nodefaults
create-args: >-
python=3.10
gmt=${{ matrix.gmt_version }}
ghostscript<10
numpy
pandas<2
xarray
netCDF4
packaging
contextily
geopandas
ipython
pyarrow
rioxarray
sphinx-gallery
make
pip
python-build
pytest
pytest-doctestplus
pytest-mpl
# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
run: |
# Download cached files to ~/.gmt directory and list them
gh run download --name gmt-cache --dir ~/.gmt/
# Change modification times of the two files, so GMT won't refresh it
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and
# in the `~/.gmt` directory for GMT>=6.5.
mkdir -p ~/.gmt/server/
mv ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
ls -lhR ~/.gmt
env:
GH_TOKEN: ${{ github.token }}
# Install the package that we want to test
- name: Install the package
run: make install
# Run the tests but skip images
- name: Run tests
run: make test_no_images PYTEST_EXTRA="-r P"