Skip to content

Commit

Permalink
Merge pull request #458 from bouthilx/test-github-actions
Browse files Browse the repository at this point in the history
Migrate from Travis to github actions
  • Loading branch information
bouthilx authored Nov 6, 2020
2 parents a77eb6f + 832c4d3 commit d97fbcd
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 115 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: ci

on: [pull_request]

jobs:
pretest:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
toxenv: [flake8, pylint, doc8, docs]

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e ${{ matrix.toxenv }}
test:
needs: pretest
runs-on: ${{ matrix.platform }}
strategy:
max-parallel: 4
matrix:
platform: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Configure MongoDB
run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox -e py
tox -e final-coverage
tox -e codecov
env:
PLATFORM: ${{ matrix.platform }}
backward-compatibility:
needs: pretest
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
orion_db_type: [mongodb, pickleddb]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Configure MongoDB
run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox -e backward-compatibility
tox -e final-coverage
tox -e codecov
env:
ORION_DB_TYPE: ${{ matrix.orion_db_type }}
pypi:
needs: [test, backward-compatibility]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e packaging
conda:
needs: [test, backward-compatibility]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Conda build
run: ./conda/conda_test.sh
114 changes: 114 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: build

on:
schedule:
- cron: '44 4 * * *'

jobs:
pretest:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
toxenv: [flake8, pylint, doc8, docs]

steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e ${{ matrix.toxenv }}
test:
needs: pretest
runs-on: ${{ matrix.platform }}
strategy:
max-parallel: 4
matrix:
platform: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Configure MongoDB
run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox -e py
tox -e final-coverage
tox -e codecov
env:
PLATFORM: ${{ matrix.platform }}
backward-compatibility:
needs: pretest
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
orion_db_type: [mongodb, pickleddb]
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.2
- name: Configure MongoDB
run: mongo orion_test --eval 'db.createUser({user:"user",pwd:"pass",roles:["readWrite"]});'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox -e backward-compatibility
tox -e final-coverage
tox -e codecov
env:
ORION_DB_TYPE: ${{ matrix.orion_db_type }}
pypi:
needs: [test, backward-compatibility]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox -e packaging
conda:
needs: [test, backward-compatibility]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Conda build
run: ./conda/conda_test.sh
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

23 changes: 1 addition & 22 deletions conda/conda_build.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
#!/bin/bash

set -e
set -x

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda config --set channel_priority strict

pip uninstall -y setuptools
conda install -c anaconda setuptools

conda update -q conda
conda info -a
conda install conda-build anaconda-client

conda build conda --python 3.6
conda build conda --python 3.6
conda build conda --python 3.7
conda build conda --python 3.8
./conda/conda_test.sh

if [[ -n "${TRAVIS_TAG}" ]]
then
Expand Down
31 changes: 31 additions & 0 deletions conda/conda_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -e
set -x

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda config --set channel_priority strict

pip uninstall -y setuptools
conda install -c anaconda setuptools

conda update -q conda
conda info -a
conda install conda-build anaconda-client

conda build conda --python 3.6
conda build conda --python 3.7
conda build conda --python 3.8

if [[ -n "${TRAVIS_TAG}" ]]
then
mkdir -p conda-bld/linux-64
cp $HOME/miniconda/conda-bld/linux-64/orion* conda-bld/linux-64/
conda convert --platform all conda-bld/linux-64/orion* --output-dir conda-bld/
anaconda -t $ANACONDA_TOKEN upload conda-bld/**/orion*
fi
Loading

0 comments on commit d97fbcd

Please sign in to comment.