-
Notifications
You must be signed in to change notification settings - Fork 27
87 lines (68 loc) · 2.16 KB
/
ci-tests-pypi.yml
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
# Reference:
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-python
# - https://github.com/awalsh128/cache-apt-pkgs-action
name: ci-tests-pypi
on:
pull_request:
schedule:
# every day @ 00h03
- cron: "3 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
env:
ALLOW_PLOTTING: "true"
CARTOPY_SHARE_DIR: ~/.local/share/cartopy
GEOVISTA_POOCH_MUTE: true
PY_COLORS: "1"
SHELLOPTS: "errexit:pipefail"
jobs:
test-pypi:
name: "test pypi (py${{ matrix.version }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: "apt cache"
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad
with:
packages: libgl1-mesa-glx xvfb
version: 1.0
- name: "pip install"
run: |
pip install --no-cache-dir -e .[test,exam,cmap]
- name: "pip freeze"
run: |
pip freeze
- name: "download cartopy assets"
run: |
mkdir -p ${CARTOPY_SHARE_DIR}
python -m cartopy.feature.download physical --output ${CARTOPY_SHARE_DIR} --no-warn
- name: "test pypi (py${{ matrix.version }})"
run: |
pytest --xvfb-backend xvfb --fail_extra_image_cache --generated_image_dir test_images
- name: "report failure"
if: failure() && github.event_name == 'schedule'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TITLE="chore: pypi test failure"
BODY=$(cat <<EOL
The \`py${{ matrix.version }}\` tests for the latest resolved \`pip\` environment have failed.
Please investigate GHA run-id [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
EOL
)
gh issue create --title "${TITLE}" --body "${BODY}" --label "bot" --label "new: issue" --repo "${{ github.repository }}"