Skip to content

Commit fda76fe

Browse files
committed
Move macOS and Windows CI from Azure to GHA
1 parent e610022 commit fda76fe

File tree

11 files changed

+169
-131
lines changed

11 files changed

+169
-131
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
PANDAS_CI: "1"
1414
steps:
1515
- checkout
16-
- run: ci/setup_env.sh
16+
- run: .circleci/setup_env.sh
1717
- run: PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH ci/run_tests.sh
1818

1919
workflows:
File renamed without changes.

.github/actions/build_pandas/action.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,25 @@ description: Rebuilds the C extensions and installs pandas
33
runs:
44
using: composite
55
steps:
6-
76
- name: Environment Detail
87
run: |
9-
conda info
10-
conda list
8+
if which mamba 2>/dev/null; then
9+
mamba info
10+
mamba list
11+
mamba info | grep -Ei 'environment.+:' | grep -qEiv 'environment.+:.+none'
12+
fi
13+
pip list
14+
python --version
1115
shell: bash -el {0}
1216

1317
- name: Build Pandas
1418
run: |
15-
python setup.py build_ext -j 2
16-
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
19+
which python
20+
which pip
21+
time python setup.py build_ext -v -j 3
22+
pip install -v -e . --no-build-isolation --no-use-pep517 --no-index
23+
shell: bash -el {0}
24+
25+
- name: Build Version
26+
run: pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd
1727
shell: bash -el {0}

.github/actions/run-tests/action.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Run tests and report results
2+
inputs:
3+
check-pyarrow-version:
4+
required: false
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Check PyArrow version
9+
run: |
10+
# Double check that we have the expected PyArrow
11+
pushd /tmp
12+
python -c "import pandas; pandas.show_versions()" | egrep -i "pyarrow.+: ${{ matrix.check-pyarrow-version }}"
13+
popd
14+
shell: bash -el {0}
15+
if: ${{ inputs.check-pyarrow-version }}
16+
17+
- name: Test
18+
run: ci/run_tests.sh
19+
shell: bash -el {0}
20+
21+
- name: Publish test results
22+
uses: actions/upload-artifact@v2
23+
with:
24+
name: Test results
25+
path: test-data.xml
26+
if: failure()
27+
28+
- name: Upload coverage to Codecov
29+
uses: codecov/codecov-action@v2
30+
with:
31+
flags: unittests
32+
name: codecov-pandas
33+
fail_ci_if_error: false
34+
if: failure()

.github/actions/setup/action.yml

+52-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
11
name: Set up pandas
22
description: Runs all the setup steps required to have a built pandas ready to use
3+
inputs:
4+
environment-file:
5+
default: environment.yml
6+
pyarrow-version:
7+
required: false
8+
is-pypy:
9+
default: false
10+
environment-name:
11+
default: pandas-dev
12+
python-version:
13+
required: false
314
runs:
415
using: composite
516
steps:
6-
- name: Setting conda path
7-
run: echo "${HOME}/miniconda3/bin" >> $GITHUB_PATH
8-
shell: bash -el {0}
17+
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
18+
run: |
19+
grep -q ' - pyarrow' ${{ inputs.environment-file }}
20+
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
21+
cat ${{ inputs.environment-file }}
22+
shell: bash
23+
if: ${{ inputs.pyarrow-version }}
924

10-
- name: Setup environment and build pandas
11-
run: ci/setup_env.sh
12-
shell: bash -el {0}
25+
- name: Set Python version in ${{ inputs.environment-file }} to ${{ inputs.python-version }}
26+
run: |
27+
echo " - python=${{ inputs.pyarrow-version }}" >> ${{ inputs.environment-file }}
28+
cat ${{ inputs.environment-file }}
29+
shell: bash
30+
if: ${{ inputs.python-version }}
31+
32+
- name: Pin setuptools (GH#44980)
33+
run: |
34+
echo ' - setuptools <60' >> ${{ inputs.environment-file }}
35+
shell: bash
36+
37+
- name: Install ${{ inputs.environment-file }} (Python ${{ inputs.python-version }})
38+
uses: conda-incubator/setup-miniconda@v2
39+
with:
40+
activate-environment: ${{ inputs.environment-name }}
41+
environment-file: ${{ inputs.environment-file }}
42+
channel-priority: strict
43+
channels: conda-forge
44+
mamba-version: "0.22"
45+
use-mamba: true
46+
if: ${{ inputs.is-pypy == 'false' }} # No pypy3.8 support
47+
48+
- name: Setup PyPy
49+
uses: actions/setup-python@v3
50+
with:
51+
python-version: "pypy-3.8"
52+
if: ${{ inputs.is-pypy == 'true' }}
53+
54+
- name: Setup PyPy dependencies
55+
# TODO: re-enable cov, its slowing the tests down though
56+
run: pip install Cython numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 hypothesis>=5.5.3 pytest-asyncio>=0.17
57+
shell: bash
58+
if: ${{ inputs.is-pypy == 'true' }}

.github/workflows/macos-windows.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: macOS and Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.4.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
14+
15+
env:
16+
PANDAS_CI: 1
17+
PYTEST_TARGET: pandas
18+
PYTEST_WORKERS: auto
19+
PATTERN: "not slow and not db and not network and not single_cpu"
20+
21+
jobs:
22+
pytest:
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: bash -el {0}
27+
timeout-minutes: 120
28+
strategy:
29+
matrix:
30+
os: [macos-10.15, windows-2019]
31+
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
32+
pyarrow_version: [6]
33+
fail-fast: false
34+
name: ${{ matrix.name || format('{0} {1} pyarrow={2}', matrix.os, matrix.env_file, matrix.pyarrow_version) }}
35+
concurrency:
36+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
37+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.env_file }}-${{ matrix.pyarrow_version }}-mac-win
38+
cancel-in-progress: true
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
with:
44+
fetch-depth: 0
45+
46+
- name: wmic.exe
47+
run: wmic.exe cpu get caption, deviceid, name, numberofcores, maxclockspeed
48+
if: ${{ runner.os == 'Windows' }}
49+
50+
- name: Set up Conda (${{ matrix.env_file }}, Arrow ${{ matrix.pyarrow_version}})
51+
uses: ./.github/actions/setup
52+
with:
53+
environment-file: ci/deps/${{ matrix.env_file }}
54+
pyarrow-version: ${{ matrix.pyarrow_version }}
55+
56+
- name: Build pandas
57+
uses: ./.github/actions/build_pandas
58+
59+
- name: Run tests
60+
uses: ./.github/actions/run-tests
61+
with:
62+
check-pyarrow-version: ${{ matrix.pyarrow_version }}

azure-pipelines.yml

-10
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ variables:
2222
PANDAS_CI: 1
2323

2424
jobs:
25-
- template: ci/azure/posix.yml
26-
parameters:
27-
name: macOS
28-
vmImage: macOS-10.15
29-
30-
- template: ci/azure/windows.yml
31-
parameters:
32-
name: Windows
33-
vmImage: windows-2019
34-
3525
- job: py38_32bit
3626
pool:
3727
vmImage: ubuntu-18.04

ci/azure/posix.yml

-50
This file was deleted.

ci/azure/windows.yml

-58
This file was deleted.

ci/run_tests.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ if [[ "$PATTERN" ]]; then
3030
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
3131
fi
3232

33+
which pytest
34+
which python
35+
pytest -VV || true
36+
python -VV || true
3337
echo $PYTEST_CMD
3438
sh -c "$PYTEST_CMD"
3539

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def run(self):
334334
extra_compile_args.append("/Z7")
335335
extra_link_args.append("/DEBUG")
336336
else:
337-
# PANDAS_CI=1 is set by ci/setup_env.sh
337+
# PANDAS_CI=1 is set in CI
338338
if os.environ.get("PANDAS_CI", "0") == "1":
339339
extra_compile_args.append("-Werror")
340340
if debugging_symbols_requested:

0 commit comments

Comments
 (0)