Skip to content

Commit 39b27dd

Browse files
authored
Merge pull request #32395 from greglucas/ci/windows-github-actions
CI: Move appveyor/azure jobs to GitHub actions
2 parents 02e27ee + 606536c commit 39b27dd

16 files changed

Lines changed: 266 additions & 1091 deletions

‎.appveyor.yml‎

Lines changed: 0 additions & 106 deletions
This file was deleted.
Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
---
2+
name: Windows tests
3+
4+
on:
5+
push:
6+
branches-ignore:
7+
- auto-backport-of-pr-[0-9]+
8+
- v[0-9]+.[0-9]+.[0-9x]+-doc
9+
- dependabot/**
10+
pull_request:
11+
branches-ignore:
12+
- v[0-9]+.[0-9]+.[0-9x]+-doc
13+
paths-ignore:
14+
- 'doc/**'
15+
- 'galleries/**'
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
20+
cancel-in-progress: true
21+
22+
permissions: {}
23+
24+
env:
25+
PYTHONFAULTHANDLER: 1
26+
PYTHONIOENCODING: UTF-8
27+
28+
jobs:
29+
pip-msvc:
30+
if: >-
31+
github.event_name == 'workflow_dispatch' ||
32+
(
33+
github.repository == 'matplotlib/matplotlib' &&
34+
!contains(github.event.head_commit.message, '[ci skip]') &&
35+
!contains(github.event.head_commit.message, '[skip ci]') &&
36+
!contains(github.event.head_commit.message, '[skip github]') &&
37+
!contains(github.event.head_commit.message, '[ci doc]')
38+
)
39+
permissions:
40+
contents: read
41+
name: "pip/MSVC: Python ${{ matrix.python-version }} on ${{ matrix.os }}"
42+
runs-on: ${{ matrix.os }}
43+
timeout-minutes: 30
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- os: windows-2022
49+
python-version: '3.12'
50+
- os: windows-latest
51+
python-version: '3.13'
52+
53+
steps:
54+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
55+
with:
56+
fetch-depth: 0
57+
persist-credentials: false
58+
59+
- name: Set up Python ${{ matrix.python-version }}
60+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
61+
with:
62+
python-version: ${{ matrix.python-version }}
63+
64+
- name: Cache pip
65+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
66+
with:
67+
path: ~\AppData\Local\pip\Cache
68+
key: windows-${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
69+
restore-keys: |
70+
windows-${{ matrix.os }}-py${{ matrix.python-version }}-pip-
71+
72+
- name: Install OS dependencies
73+
run: choco install ninja --yes --no-progress
74+
75+
- name: Install Python dependencies
76+
run: |
77+
python -m pip install --upgrade pip
78+
python -m pip install --upgrade --group build
79+
python -m pip install --prefer-binary --group test --group test-extra
80+
81+
- name: Build Matplotlib with MSVC coverage support
82+
run: |
83+
python -m pip install --no-build-isolation --verbose --editable '.[dev]' `
84+
--config-settings=setup-args=--vsenv `
85+
--config-settings=setup-args=-Dcpp_link_args=-PROFILE `
86+
--config-settings=setup-args=-Dbuildtype=debug
87+
88+
- name: Show environment
89+
run: |
90+
Get-ChildItem Env: | Sort-Object Name
91+
python -m pip list
92+
git describe
93+
94+
- name: Instrument extension modules and start native coverage collector
95+
shell: bash
96+
run: |
97+
vswhere='/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe'
98+
vs=$("$vswhere" -latest -products '*' -property installationPath | tr -d '\r')
99+
tool_dir="$vs/Common7/IDE/Extensions/Microsoft/CodeCoverage.Console"
100+
tool=$(cygpath -u "$tool_dir/Microsoft.CodeCoverage.Console.exe")
101+
if [[ ! -x $tool ]]; then
102+
echo "Microsoft.CodeCoverage.Console.exe was not found at $tool"
103+
exit 1
104+
fi
105+
106+
session_id=$(python -c "import uuid; print(uuid.uuid4(), end='')")
107+
echo "VS_COVERAGE_TOOL=$tool" >> "$GITHUB_ENV"
108+
echo "COVERAGE_SESSION_ID=$session_id" >> "$GITHUB_ENV"
109+
echo "Coverage tool: $tool"
110+
echo "Coverage session: $session_id"
111+
112+
for module in build/cp*/src/*.pyd; do
113+
echo "Instrumenting $module"
114+
"$tool" instrument "$module" --session-id "$session_id" \
115+
--log-level Verbose --log-file instrument.log
116+
cat instrument.log
117+
done
118+
119+
"$tool" collect --session-id "$session_id" --server-mode \
120+
--output-format cobertura --output extensions.xml \
121+
--log-level Verbose --log-file extensions.log &
122+
123+
- name: Run pytest
124+
run: |
125+
python -m pytest -rfEsXR -n auto `
126+
--maxfail=50 --timeout=300 --durations=25 --log-level=DEBUG `
127+
--cov-report=xml:coverage.xml --cov=lib
128+
129+
- name: Stop native coverage collector
130+
if: always()
131+
shell: bash
132+
run: |
133+
if [[ -n $VS_COVERAGE_TOOL && -n $COVERAGE_SESSION_ID ]]; then
134+
"$VS_COVERAGE_TOOL" shutdown "$COVERAGE_SESSION_ID"
135+
fi
136+
if [[ -f extensions.log ]]; then
137+
echo 'Native coverage collection log'
138+
cat extensions.log
139+
fi
140+
141+
- name: Upload code coverage
142+
if: ${{ !cancelled() }}
143+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
144+
with:
145+
files: coverage.xml,extensions.xml
146+
name: "${{ matrix.python-version }} ${{ matrix.os }}"
147+
token: ${{ secrets.CODECOV_TOKEN }}
148+
149+
- name: Upload failed image comparisons
150+
if: failure()
151+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
152+
with:
153+
name: pip-msvc-${{ matrix.os }}-py${{ matrix.python-version }}-result-images
154+
path: result_images
155+
156+
conda:
157+
if: >-
158+
github.event_name == 'workflow_dispatch' ||
159+
(
160+
github.repository == 'matplotlib/matplotlib' &&
161+
!contains(github.event.head_commit.message, '[ci skip]') &&
162+
!contains(github.event.head_commit.message, '[skip ci]') &&
163+
!contains(github.event.head_commit.message, '[skip github]') &&
164+
!contains(github.event.head_commit.message, '[ci doc]')
165+
)
166+
permissions:
167+
contents: read
168+
name: "conda-forge: Python 3.12 on windows-2022"
169+
runs-on: windows-2022
170+
timeout-minutes: 30
171+
172+
steps:
173+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
174+
with:
175+
fetch-depth: 50
176+
persist-credentials: false
177+
178+
- name: Cache pip
179+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
180+
with:
181+
path: ~\AppData\Local\pip\Cache
182+
key: windows-conda-py312-pip-${{ hashFiles('environment.yml') }}
183+
restore-keys: |
184+
windows-conda-py312-pip-
185+
186+
- name: Cache Matplotlib
187+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
188+
with:
189+
path: ~\.cache\matplotlib
190+
key: windows-conda-py312-mpl-${{ github.ref }}-${{ github.sha }}
191+
restore-keys: |
192+
windows-conda-py312-mpl-${{ github.ref }}-
193+
windows-conda-py312-mpl-
194+
195+
- name: Set up micromamba
196+
uses: mamba-org/setup-micromamba@f457c30a868e4760d3a6fcea5f25dc655b8edf39 # v3
197+
with:
198+
micromamba-version: 2.9.0-0
199+
micromamba-root-path: ${{ runner.temp }}\micromamba
200+
init-shell: none
201+
cache-downloads: true
202+
cache-downloads-key: windows-conda-py312-${{ hashFiles('environment.yml') }}
203+
204+
# Create the environment explicitly, rather than via setup-micromamba's
205+
# environment-file option, so that we can add extra packages on top of
206+
# environment.yml.
207+
- name: Create conda environment
208+
env:
209+
MAMBA_ROOT_PREFIX: ${{ runner.temp }}\micromamba
210+
run: |
211+
micromamba create --yes --name mpl-dev --file environment.yml `
212+
python=3.12 pywin32 codecov ffmpeg inkscape
213+
214+
- name: Build Matplotlib
215+
env:
216+
MAMBA_ROOT_PREFIX: ${{ runner.temp }}\micromamba
217+
run: |
218+
$env:LINK = "/LIBPATH:$pwd\lib"
219+
micromamba run --name mpl-dev python -m pip install --verbose `
220+
--no-build-isolation --editable '.[dev]'
221+
222+
- name: Verify TkAgg backend
223+
env:
224+
MAMBA_ROOT_PREFIX: ${{ runner.temp }}\micromamba
225+
run: |
226+
micromamba run --name mpl-dev python -c `
227+
"import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())"
228+
229+
- name: Run pytest
230+
env:
231+
MAMBA_ROOT_PREFIX: ${{ runner.temp }}\micromamba
232+
run: |
233+
micromamba run --name mpl-dev python -m pytest -rfEsXR -n auto `
234+
--timeout=300 --durations=25 --log-level=DEBUG `
235+
--cov-report=xml:coverage-conda.xml --cov=lib
236+
237+
- name: Upload code coverage
238+
if: ${{ !cancelled() }}
239+
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
240+
with:
241+
files: coverage-conda.xml
242+
name: "3.12 windows-2022 conda-forge"
243+
token: ${{ secrets.CODECOV_TOKEN }}
244+
245+
- name: Upload failed image comparisons
246+
if: failure()
247+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
248+
with:
249+
name: conda-windows-2022-py312-result-images
250+
path: result_images

‎.pre-commit-config.yaml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,10 @@ repos:
9595
- repo: https://github.com/python-jsonschema/check-jsonschema
9696
rev: 5030dca3047414c338091455ac41803200ec1f0f # frozen: 0.37.3
9797
hooks:
98-
# TODO: Re-enable this when https://github.com/microsoft/azure-pipelines-vscode/issues/567 is fixed.
99-
# - id: check-azure-pipelines
10098
- id: check-dependabot
10199
- id: check-github-workflows
102100
# NOTE: If any of the below schema files need to be changed, be sure to
103101
# update the `ci/vendor_schemas.py` script.
104-
- id: check-jsonschema
105-
name: "Validate AppVeyor config"
106-
files: ^\.appveyor\.yml$
107-
args: ["--verbose", "--schemafile", "ci/schemas/appveyor.json"]
108102
- id: check-jsonschema
109103
name: "Validate CircleCI config"
110104
files: ^\.circleci/config\.yml$

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
[![Contributing](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?)](https://matplotlib.org/stable/devel/index.html)
1111

1212
[![GitHub actions status](https://github.com/matplotlib/matplotlib/workflows/Tests/badge.svg)](https://github.com/matplotlib/matplotlib/actions?query=workflow%3ATests)
13-
[![Azure pipelines status](https://dev.azure.com/matplotlib/matplotlib/_apis/build/status/matplotlib.matplotlib?branchName=main)](https://dev.azure.com/matplotlib/matplotlib/_build/latest?definitionId=1&branchName=main)
14-
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/github/matplotlib/matplotlib?branch=main&svg=true)](https://ci.appveyor.com/project/matplotlib/matplotlib)
1513
[![Codecov status](https://codecov.io/github/matplotlib/matplotlib/badge.svg?branch=main&service=github)](https://app.codecov.io/gh/matplotlib/matplotlib)
1614
[![EffVer Versioning](https://img.shields.io/badge/version_scheme-EffVer-0097a7)](https://jacobtomlinson.dev/effver)
1715

0 commit comments

Comments
 (0)