Skip to content

Commit

Permalink
Configure CI with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Apr 10, 2020
1 parent 8b86d87 commit 4c67d19
Show file tree
Hide file tree
Showing 24 changed files with 333 additions and 154 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/build-linux.yml
@@ -0,0 +1,92 @@
name: Linux tests

on:
# This avoids having duplicate builds for a pull request
push:
branches:
- master
- 5.x
- 4.x
pull_request:
branches:
- master
- 5.x
- 4.x

jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: ubuntu-latest
env:
CI: 'true'
CODECOV_TOKEN: "56731c25-9b1f-4340-8b58-35739bfbc52d"
OS: 'linux'
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUN_SLOW: ${{ matrix.TEST_TYPE == 'slow' }}
USE_CONDA: ${{ matrix.INSTALL_TYPE == 'conda' }}
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['conda', 'pip']
PYTHON_VERSION: ['3.7', '2.7']
TEST_TYPE: ['fast', 'slow']
exclude:
- INSTALL_TYPE: 'pip'
PYTHON_VERSION: '2.7'
TEST_TYPE: 'fast'
- INSTALL_TYPE: 'pip'
PYTHON_VERSION: '2.7'
TEST_TYPE: 'slow'
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0
- name: Checkout branch
uses: actions/checkout@v1.2.0
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
auto-update-conda: true
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Create test environment
shell: bash -l {0}
run: |
bash -l .github/workflows/install.sh
- name: Show test environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: |
xvfb-run --auto-servernum python runtests.py
- name: Run application test
shell: bash -l {0}
run: |
xvfb-run --auto-servernum python bootstrap.py -- --reset
- name: Run manifest checks
shell: bash -l {0}
run: |
check-manifest
- name: Coverage
shell: bash -l {0}
run: |
codecov
69 changes: 69 additions & 0 deletions .github/workflows/build-mac.yml
@@ -0,0 +1,69 @@
name: Mac tests

on:
# This avoids having duplicate builds for a pull request
push:
branches:
- master
- 5.x
- 4.x
pull_request:
branches:
- master
- 5.x
- 4.x

jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: macos-latest
env:
CI: 'true'
CODECOV_TOKEN: "56731c25-9b1f-4340-8b58-35739bfbc52d"
OS: 'macos'
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUN_SLOW: ${{ matrix.TEST_TYPE == 'slow' }}
USE_CONDA: ${{ matrix.INSTALL_TYPE == 'conda' }}
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['conda']
PYTHON_VERSION: ['3.7', '2.7']
TEST_TYPE: ['fast', 'slow']
steps:
- name: Checkout branch
uses: actions/checkout@v1.2.0
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
auto-update-conda: true
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Create test environment
shell: bash -l {0}
run: |
bash -l .github/workflows/install.sh
- name: Show test environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: |
python runtests.py
- name: Run application test
shell: bash -l {0}
run: |
python bootstrap.py -- --reset
- name: Coverage
shell: bash -l {0}
run: |
codecov
76 changes: 76 additions & 0 deletions .github/workflows/build-win.yml
@@ -0,0 +1,76 @@
name: Win tests

on:
# This avoids having duplicate builds for a pull request
push:
branches:
- master
- 5.x
- 4.x
pull_request:
branches:
- master
- 5.x
- 4.x

jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: windows-latest
env:
CI: 'true'
CODECOV_TOKEN: "56731c25-9b1f-4340-8b58-35739bfbc52d"
OS: 'win'
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUN_SLOW: ${{ matrix.TEST_TYPE == 'slow' }}
USE_CONDA: ${{ matrix.INSTALL_TYPE == 'conda' }}
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['conda']
PYTHON_VERSION: ['3.7', '2.7']
TEST_TYPE: ['fast', 'slow']
steps:
- name: Checkout branch
uses: actions/checkout@v1.2.0
- name: Cache pip
uses: actions/cache@v1
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
auto-update-conda: true
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Create test environment
shell: bash -l {0}
run: |
bash -l .github/workflows/install.sh
- name: Show test environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: |
python runtests.py
- name: Run application test
shell: bash -l {0}
run: |
python bootstrap.py -- --reset
- name: Coverage
shell: bash -l {0}
run: |
codecov
@@ -1,33 +1,25 @@
#!/bin/bash -ex

# -- Installl dependencies
if [ "$USE_CONDA" = "yes" ]; then
# Avoid problems with invalid SSL certificates
if [ "$PYTHON_VERSION" = "2.7" ]; then
conda install -q -y python=2.7.16=h97142e2_0
fi
# Install dependencies
if [ "$USE_CONDA" = "true" ]; then

# Install nomkl to avoid installing Intel MKL libraries
conda install -q -y nomkl
if [ "$OS" != "win" ]; then
# Install nomkl to avoid installing Intel MKL libraries
conda install nomkl -q -y
fi

# Install main dependencies
conda install -q -y -c spyder-ide --file requirements/conda.txt
conda install python=$PYTHON_VERSION --file requirements/conda.txt -q -y

# Install test ones
conda install -q -y -c spyder-ide --file requirements/tests.txt

# Github backend tests are failing with 1.1.1d
conda install -q -y openssl=1.1.1c
conda install python=$PYTHON_VERSION --file requirements/tests.txt -c spyder-ide -q -y

# Remove spyder-kernels to be sure that we use its subrepo
conda remove -q -y --force spyder-kernels
conda remove spyder-kernels --force -q -y

# Install python-language-server from Github with no deps
pip install -q --no-deps git+https://github.com/palantir/python-language-server
pip install --no-deps git+https://github.com/palantir/python-language-server -q
else
# Github backend tests are failing with 1.1.1d
conda install -q -y openssl=1.1.1c

# Update pip and setuptools
pip install -U pip setuptools

Expand All @@ -44,19 +36,22 @@ else
pip install git+https://github.com/jupyter/qtconsole.git

# Remove spyder-kernels to be sure that we use its subrepo
pip uinstall -q -y spyder-kernels
pip uninstall spyder-kernels -q -y

# Install python-language-server from Github
pip install -q git+https://github.com/palantir/python-language-server
pip install git+https://github.com/palantir/python-language-server -q
fi

# To check our manifest
pip install check-manifest

# Create environment for Jedi environments testsTest for Jedi environments
# Create environment for Jedi environments tests
conda create -n jedi-test-env -q -y python=3.6 flask spyder-kernels
conda list -n jedi-test-env

# Create environment to test conda activation before launching a spyder kernel
conda create -n spytest-ž -q -y python=3.6 spyder-kernels
conda list -n spytest-ž

# Coverage
conda install -n test codecov
7 changes: 7 additions & 0 deletions conftest.py
Expand Up @@ -15,6 +15,13 @@
import os.path as osp
import shutil
import sys
import warnings


if sys.version_info[0] == 2:
# Hide warnings on py2 due to qtawesome as it makes the results unreadable
warnings.filterwarnings("ignore")


# To activate/deactivate certain things for pytest's only
# NOTE: Please leave this before any other import here!!
Expand Down
68 changes: 0 additions & 68 deletions continuous_integration/azure/install.bat

This file was deleted.

0 comments on commit 4c67d19

Please sign in to comment.