Skip to content

WIP: All the CI in GitHub actions (DO NOT MERGE) #29715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d127721
Adding db build to actions
datapythonista Nov 16, 2019
3c3f25d
Replacing with by env
datapythonista Nov 16, 2019
173b60a
Merge remote-tracking branch 'upstream/master' into db_build_to_actions
datapythonista Nov 17, 2019
f135254
Adding mysql service
datapythonista Nov 17, 2019
91ab51d
Fixing indentation
datapythonista Nov 17, 2019
e374623
Adding ports and healthchecks to db services
datapythonista Nov 17, 2019
54e1f3d
disabling mysql health checks
datapythonista Nov 17, 2019
f235e9b
using latest versions of dbs
datapythonista Nov 17, 2019
be4f827
Adding database creation
datapythonista Nov 17, 2019
2677a0e
Fixing how to provide an env variable to if
datapythonista Nov 17, 2019
211a426
Testing mysql
datapythonista Nov 17, 2019
525f3a3
More mysql tests
datapythonista Nov 18, 2019
b355d2f
Trying to create dbs
datapythonista Nov 18, 2019
75c9dcd
Working on making the databases work
datapythonista Nov 18, 2019
63df9a2
Merge remote-tracking branch 'upstream/master' into db_build_to_actions
datapythonista Nov 18, 2019
4ea0cd9
Adding jobs to existing build
datapythonista Nov 18, 2019
87b4197
Fixing typo in postgres call, better matrix
datapythonista Nov 18, 2019
267c6c3
Debugging matrix and grep problems
datapythonista Nov 18, 2019
e32bbd8
More debugging and trials
datapythonista Nov 18, 2019
f92bd8b
More debugging
datapythonista Nov 18, 2019
f20c3d0
More debugging
datapythonista Nov 18, 2019
3a80742
More debugging
datapythonista Nov 18, 2019
449865d
Copying exact configuration from rails blog
datapythonista Nov 18, 2019
6d830d0
Some more debugging
datapythonista Nov 18, 2019
02061c1
Rewriting the mysterious failing code in code_checks.sh
datapythonista Nov 18, 2019
89ed130
Another mysql test
datapythonista Nov 18, 2019
9540ff3
Getting closer to get mysql working
datapythonista Nov 18, 2019
b149ce8
Fixing password
datapythonista Nov 18, 2019
3beafd2
s/username/user
datapythonista Nov 18, 2019
71f8b40
Checking why password doesn't work
datapythonista Nov 18, 2019
5cd9dc6
This should fix the mysql database creation
datapythonista Nov 18, 2019
346e5c2
Fixing typo
datapythonista Nov 18, 2019
988ea6b
This should leave everything in place regarding dbs
datapythonista Nov 18, 2019
8370b44
Merge remote-tracking branch 'upstream/master' into db_build_to_actions
datapythonista Nov 18, 2019
a81fd0a
Adding all builds to actions
datapythonista Nov 18, 2019
c262653
Making progress on the finalize task
datapythonista Nov 18, 2019
c063c0d
Fixing Python code in yaml
datapythonista Nov 18, 2019
ee07631
Trying to remove colon to fix syntax error
datapythonista Nov 19, 2019
457635b
Removing Python code which was causing problems
datapythonista Nov 19, 2019
7482cd3
Fixing indentation
datapythonista Nov 19, 2019
f72c17c
Using different jobs for db tests and the rest, and setting conda pat…
datapythonista Nov 22, 2019
b3a52e7
Restoing env removed by mistake
datapythonista Nov 22, 2019
191e7d2
Merge remote-tracking branch 'upstream/master' into db_build_to_actions
datapythonista Nov 24, 2019
df925f7
Trying to set path after checkout
datapythonista Nov 24, 2019
8c86bab
First version using rclone, and debug information added
datapythonista Nov 24, 2019
9343ea6
Several fixes (locale, 32 bits, docs, db)
datapythonista Nov 24, 2019
b4970b3
Improvements to the docs job
datapythonista Nov 25, 2019
dc4d805
Couple more fixes (windows bash, ipython grep)
datapythonista Nov 25, 2019
d26d883
Merge remote-tracking branch 'upstream/master' into db_build_to_actions
datapythonista Nov 26, 2019
f0a4030
Trying to fix grep of ipython directive
datapythonista Nov 26, 2019
a202e94
bash command in quotes
datapythonista Nov 26, 2019
ca23a17
Trying more fixes for grep, downloading conda for windows, and small …
datapythonista Nov 26, 2019
0a3e792
Fixed typo detecting windows OS
datapythonista Nov 26, 2019
41dd0c7
Temporary fixing error in master
datapythonista Nov 26, 2019
b40501c
Quoting command, needed when starts with exclamation mark
datapythonista Nov 26, 2019
79bfd82
Fixing path of pr docs, adding clean up task
datapythonista Nov 27, 2019
134c651
Merging from master
datapythonista Dec 1, 2019
4647b0d
Removing changes to localization tests, addressed in a separate PR, a…
datapythonista Dec 1, 2019
76aca4b
Removing duplicated set-path
datapythonista Dec 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
307 changes: 307 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,310 @@ jobs:
name: Benchmarks log
path: asv_bench/benchmarks.log
if: failure()

- name: Create build output artifact
run: |
echo $STEPS_CONTEXT > build_output.json
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
if: job.status == 'failure'

- name: Upload build output artifact
uses: actions/upload-artifact@master
with:
name: build_output_checks
path: build_output.json
if: job.status == 'failure'

web_and_docs:
name: Web and docs
runs-on: ubuntu-latest
steps:

- name: Setting conda path
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"

- name: Checkout
uses: actions/checkout@v1

- name: Setup environment and build pandas
run: ci/setup_env.sh

- name: Build website
run: |
source activate pandas-dev
python web/pandas_web.py web/pandas --target-path=web/build

- name: Build documentation
run: |
source activate pandas-dev
doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]}

# This can be removed when the ipython directive fails when there are errors,
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
- name: Check ipython directive errors
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"

- name: Merge website and docs
run: |
mkdir -p pandas_web/docs
cp -r web/build/* pandas_web/
cp -r doc/build/html/* pandas_web/docs/

- name: Create artifact
run: |
tar -czvf pandas_web.tar.gz pandas_web

- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: pandas_web
path: pandas_web.tar.gz

- name: Install rclone
run: sudo apt install rclone -y

- name: Set up Rclone
run: |
RCLONE_CONFIG_PATH=$HOME/.config/rclone/rclone.conf
mkdir -p `dirname $RCLONE_CONFIG_PATH`
echo "[ovh_cloud_pandas_web]" > $RCLONE_CONFIG_PATH
echo "type = swift" >> $RCLONE_CONFIG_PATH
echo "env_auth = false" >> $RCLONE_CONFIG_PATH
echo "auth_version = 3" >> $RCLONE_CONFIG_PATH
echo "auth = https://auth.cloud.ovh.net/v3/" >> $RCLONE_CONFIG_PATH
echo "endpoint_type = public" >> $RCLONE_CONFIG_PATH
echo "tenant_domain = default" >> $RCLONE_CONFIG_PATH
echo "tenant = 2977553886518025" >> $RCLONE_CONFIG_PATH
echo "domain = default" >> $RCLONE_CONFIG_PATH
echo "user = w4KGs3pmDxpd" >> $RCLONE_CONFIG_PATH
echo "key = ${{ secrets.ovh_object_store_key }}" >> $RCLONE_CONFIG_PATH
echo "region = BHS" >> $RCLONE_CONFIG_PATH

- name: Sync web
run: |
REMOTE_PATH="dev"
if [[ "${{ github.event_name }}" == "pr" ]]; then
REMOTE_PATH="$REMOTE_PATH/pr/$PR_NUMBER"
fi
rclone sync pandas_web ovh_cloud_pandas_web:$REMOTE_PATH
env:
PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Create build output artifact
run: |
echo $STEPS_CONTEXT > build_output.json
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
if: job.status == 'failure'

- name: Upload build output artifact
uses: actions/upload-artifact@master
with:
name: build_output_web_and_docs
path: build_output.json
if: job.status == 'failure'

tests:
name: Tests
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
name: [py37, py37-locale, py36-minimum-versions, py36-macos, py36-32bits, py36-locale-slow, py36-np15-windows, py37-np141-windows, py37-numpydev, py36-locale-slow-old-np]
include:

# regular tests

- name: py37
os: ubuntu-latest
env_file: travis-37.yaml
pattern: "not slow and not network"

- name: py37-locale
os: ubuntu-latest
env_file: azure-37-locale.yaml
pattern: "not slow and not network"
locale_override: zh_CN.UTF-8

- name: py36-minimum-versions
os: ubuntu-latest
env_file: azure-36-minimum_versions.yaml
pattern: "not slow and not network"

- name: py36-macos
os: macos-latest
env_file: azure-macos-36.yaml
pattern: "not slow and not network"

- name: py36-32bits
os: ubuntu-latest
env_file: azure-36-32bit.yaml
pattern: "not slow and not network"
bits32: "yes"

- name: py36-locale-slow # TODO: this is not slow, see pattern
os: ubuntu-latest
env_file: azure-36-locale_slow.yaml
pattern: "not slow and not network"
locale_override: it_IT.UTF-8

- name: py36-np15-windows
os: windows-latest
env_file: azure-windows-36.yaml
pattern: "not slow and not network"

- name: py37-np141-windows
os: windows-latest
env_file: azure-windows-37.yaml
pattern: "not slow and not network"

# TODO: This is commented in azure - https://github.com/pandas-dev/pandas/issues/29432
- name: py37-numpydev
os: ubuntu-latest
env_file: azure-37-numpydev.yaml
pattern: "not slow and not network"
pandas_testing_mode: deprecate
# TODO env vars pending to add and use in the workflow
# TEST_ARGS: "-W error"
# EXTRA_APT: "xsel"

# slow tests

- name: py36-locale-slow-old-np
os: ubuntu-latest
env_file: azure-36-locale.yaml
pattern: "slow"
locale_override: zh_CN.UTF-8

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setting conda path
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"

- name: Setup environment and build pandas
shell: bash
run: ci/setup_env.sh
env:
ENV_FILE: ci/deps/${{ matrix.env_file }}
LOCALE_OVERRIDE: ${{ matrix.locale_override }}
BITS32: ${{ matrix.bits32 }}

- name: Run tests
shell: bash
run: |
source activate pandas-dev
ci/run_tests.sh
env:
PATTERN: ${{ matrix.pattern }}
PANDAS_TESTING_MODE: ${{ matrix.pandas_testing_mode }}
COVERAGE: ${{ matrix.coverage }}
LOCALE_OVERRIDE: ${{ matrix.locale_override }}

db_tests:
name: DB Tests
runs-on: ${{ matrix.os }}

services:
postgres:
image: postgres:latest
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

mysql:
image: mysql:latest
ports:
- 3306/tcp
env:
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries 5

strategy:
fail-fast: false
matrix:
name: [py36-cov, py36-locale-zh]
include:

- name: py36-cov
os: ubuntu-latest
env_file: travis-36-cov.yaml
pattern: "(not slow and not network) or (single and db)"
pandas_testing_mode: deprecate
coverage: true

- name: py36-locale-zh
os: ubuntu-latest
env_file: travis-36-locale.yaml
pattern: "(not slow and not network) or (single and db)"
locale_override: zh_CN.UTF-8

steps:
- name: Setting conda path
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"

- name: Checkout
uses: actions/checkout@v1

- name: Create PostgreSQL database
run: |
sudo apt-get install -y postgresql-client
psql --host 127.0.0.1 \
--port ${{ job.services.postgres.ports[5432] }} \
--username postgres \
--command 'CREATE DATABASE pandas_nosetest;'

- name: Create MySQL database
run: |
mysql --host 127.0.0.1 \
--port ${{ job.services.mysql.ports[3306] }} \
--user root \
-ppassword \
--execute "CREATE DATABASE pandas_nosetest;"

- name: Setup environment and build pandas
run: |
ci/setup_env.sh
env:
ENV_FILE: ci/deps/${{ matrix.env_file }}
LOCALE_OVERRIDE: ${{ matrix.locale_override }}

- name: Run tests
run: |
source activate pandas-dev
ci/run_tests.sh
env:
PATTERN: ${{ matrix.pattern }}
PANDAS_TESTING_MODE: ${{ matrix.pandas_testing_mode }}
COVERAGE: ${{ matrix.coverage }}
LOCALE_OVERRIDE: ${{ matrix.locale_override }}


finalize:
name: Finalize build
runs-on: ubuntu-latest
if: true
# TODO run when all the other jobs finish:
needs: [checks, web_and_docs]
steps:

- name: Download checks artifact
uses: actions/download-artifact@master
with:
name: build_output_checks
path: build_output_checks.json

- name: Extract errors from checks artifact
if: true # TODO temporary for debugging
run: |
export MSG="Hi @$AUTHOR, thanks for your contribution. We found the next list of errors in your pull request:"
# TODO get actual errors
export MSG="$MSG\n- [Actual messages from the log are not yet extracted](https://github.com/pandas-dev/pandas/actions)"
echo "{\"body\": \"$MSG\"}" > payload.json

- name:
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d "$(<payload.json)" https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
47 changes: 9 additions & 38 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ fi
echo "Install Miniconda"
UNAME_OS=$(uname)
if [[ "$UNAME_OS" == 'Linux' ]]; then
if [[ "$BITS32" == "yes" ]]; then
CONDA_OS="Linux-x86"
else
CONDA_OS="Linux-x86_64"
fi
CONDA_OS="Linux"
elif [[ "$UNAME_OS" == 'Darwin' ]]; then
CONDA_OS="MacOSX-x86_64"
CONDA_OS="MacOSX"
elif [[ "${UNAME_OS:0:7}" == 'MINGW64' ]]; then
CONDA_OS="Windows"
else
echo "OS $UNAME_OS not supported"
exit 1
fi

CONDA_OS="${CONDA_OS}-x86"
if [[ "$BITS32" != "yes" ]]; then
CONDA_OS="${CONDA_OS}_64"
fi

wget -q "https://repo.continuum.io/miniconda/Miniconda3-latest-$CONDA_OS.sh" -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
Expand All @@ -56,29 +59,6 @@ conda update -n base conda
echo "conda info -a"
conda info -a

echo
echo "set the compiler cache to work"
if [ -z "$NOCACHE" ] && [ "${TRAVIS_OS_NAME}" == "linux" ]; then
echo "Using ccache"
export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH
GCC=$(which gcc)
echo "gcc: $GCC"
CCACHE=$(which ccache)
echo "ccache: $CCACHE"
export CC='ccache gcc'
elif [ -z "$NOCACHE" ] && [ "${TRAVIS_OS_NAME}" == "osx" ]; then
echo "Install ccache"
brew install ccache > /dev/null 2>&1
echo "Using ccache"
export PATH=/usr/local/opt/ccache/libexec:$PATH
gcc=$(which gcc)
echo "gcc: $gcc"
CCACHE=$(which ccache)
echo "ccache: $CCACHE"
else
echo "Not using ccache"
fi

echo "source deactivate"
source deactivate

Expand Down Expand Up @@ -139,13 +119,4 @@ echo
echo "conda list"
conda list

# Install DB for Linux
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
echo "installing dbs"
mysql -e 'create database pandas_nosetest;'
psql -c 'create database pandas_nosetest;' -U postgres
else
echo "not using dbs on non-linux Travis builds or Azure Pipelines"
fi

echo "done"