Skip to content

Commit b1b788f

Browse files
jonashaagmroeschke
andauthored
Add setup-conda action (#46611)
* Add run-tests and setup-pandas actions * Undo run-tests * Use setup-pandas in docbuild * Update docbuild-and-upload.yml * Update macos-windows.yml * Update docbuild-and-upload.yml * Update action.yml * Create action.yml * Delete .github/actions/setup-pandas directory * Review feedback * Update .github/workflows/macos-windows.yml Co-authored-by: Matthew Roeschke <emailformattr@gmail.com>
1 parent 866b281 commit b1b788f

File tree

7 files changed

+46
-42
lines changed

7 files changed

+46
-42
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.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Set up Conda environment
2+
inputs:
3+
environment-file:
4+
description: Conda environment file to use.
5+
default: environment.yml
6+
pyarrow-version:
7+
description: If set, overrides the PyArrow version in the Conda environment to the given string.
8+
required: false
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
13+
run: |
14+
grep -q ' - pyarrow' ${{ inputs.environment-file }}
15+
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
16+
cat ${{ inputs.environment-file }}
17+
shell: bash
18+
if: ${{ inputs.pyarrow-version }}
19+
20+
- name: Install ${{ inputs.environment-file }}
21+
uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
environment-file: ${{ inputs.environment-file }}
24+
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
25+
channels: conda-forge
26+
mamba-version: "0.23"
27+
use-mamba: true

.github/actions/setup/action.yml

-12
This file was deleted.

.github/workflows/docbuild-and-upload.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,46 @@ jobs:
2424
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
2525
cancel-in-progress: true
2626

27+
defaults:
28+
run:
29+
shell: bash -el {0}
30+
2731
steps:
2832
- name: Checkout
2933
uses: actions/checkout@v3
3034
with:
3135
fetch-depth: 0
3236

33-
- name: Set up pandas
34-
uses: ./.github/actions/setup
37+
- name: Set up Conda
38+
uses: ./.github/actions/setup-conda
39+
40+
- name: Build Pandas
41+
uses: ./.github/actions/build_pandas
3542

3643
- name: Build website
37-
run: |
38-
source activate pandas-dev
39-
python web/pandas_web.py web/pandas --target-path=web/build
44+
run: python web/pandas_web.py web/pandas --target-path=web/build
4045

4146
- name: Build documentation
42-
run: |
43-
source activate pandas-dev
44-
doc/make.py --warnings-are-errors
47+
run: doc/make.py --warnings-are-errors
4548

4649
- name: Install ssh key
4750
run: |
4851
mkdir -m 700 -p ~/.ssh
4952
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
5053
chmod 600 ~/.ssh/id_rsa
5154
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
52-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5356

5457
- name: Copy cheatsheets into site directory
5558
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
5659

5760
- name: Upload web
5861
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
59-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6063

6164
- name: Upload dev docs
6265
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
63-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
66+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6467

6568
- name: Move docs into site directory
6669
run: mv doc/build/html web/build/docs

.github/workflows/macos-windows.yml

+3-17
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,18 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545

46-
- name: Install Dependencies
47-
uses: conda-incubator/setup-miniconda@v2.1.1
46+
- name: Set up Conda
47+
uses: ./.github/actions/setup-conda
4848
with:
49-
mamba-version: "*"
50-
channels: conda-forge
51-
activate-environment: pandas-dev
52-
channel-priority: ${{ matrix.os == 'macos-latest' && 'flexible' || 'strict' }}
5349
environment-file: ci/deps/${{ matrix.env_file }}
54-
use-only-tar-bz2: true
55-
56-
# ImportError: 2): Library not loaded: @rpath/libssl.1.1.dylib
57-
# Referenced from: /Users/runner/miniconda3/envs/pandas-dev/lib/libthrift.0.13.0.dylib
58-
# Reason: image not found
59-
- name: Upgrade pyarrow on MacOS
60-
run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=6
61-
if: ${{ matrix.os == 'macos-latest' }}
50+
pyarrow-version: ${{ matrix.os == 'macos-latest' && '6' || '' }}
6251

6352
- name: Build Pandas
6453
uses: ./.github/actions/build_pandas
6554

6655
- name: Test
6756
run: ci/run_tests.sh
6857

69-
- name: Build Version
70-
run: conda list
71-
7258
- name: Publish test results
7359
uses: actions/upload-artifact@v3
7460
with:

setup.py

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

0 commit comments

Comments
 (0)