Skip to content

Commit

Permalink
update fury test actions and add secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Nov 26, 2020
1 parent ed25ad9 commit 1ef6514
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 19 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,40 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: [3.7] # [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest]
platform: [x64]
install_type: [pip, conda]
depends: [DEFAULT_DEPS, OPTIONAL_DEPS]
pip-flags: ['']
option-flags: ['']
experimental: [false]
include:
- os: ubuntu-20.04
python-version: 3.8
depends: OPTIONAL_DEPS
BUILD_DOCS: 1
DEPLOY_DOCS: 1
option-flags: 'BUILD_DOCS DEPLOY_DOCS'
install_type: pip
experimental: true
- os: ubuntu-20.04
python-version: 3.8
install_type: pip
depends: OPTIONAL_DEPS
COVERAGE: 1
option-flags: 'COVERAGE'
experimental: false
- os: ubuntu-20.04
python-version: 3.8
install_type: pip
depends: OPTIONAL_DEPS
USE_PRE: 1
option-flags: 'USE_PRE'
experimental: true
env:
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} # Keep backward compatibilty with Travis
TRAVIS_REPO_SLUG: ${{ github.repository }} # Keep backward compatibilty with Travis
Expand All @@ -55,11 +60,13 @@ jobs:
INSTALL_TYPE: ${{ matrix.install_type }}
PRE_PIP_FLAGS: '--pre --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple'
EXTRA_PIP_FLAGS: ${{ matrix.pip-flags }}
OPTION_FLAGS: ${{ matrix.option-flags }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
Expand All @@ -85,30 +92,33 @@ jobs:
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME="${{ matrix.os }}"" >> $GITHUB_ENV; fi
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE="${{ github.event_name }}"" >> $GITHUB_ENV; fi
if [ "OPTIONAL_DEPS" == "${{ matrix.depends }}" ]; then echo "OPTIONAL_DEPS=1" >> $GITHUB_ENV; else echo "OPTIONAL_DEPS=0" >> $GITHUB_ENV; fi
python3 -c "import os; print(os.environ['OPTION_FLAGS'])"
echo "COVERAGE=$(python3 -c "import os; print(int('COVERAGE' in os.environ['OPTION_FLAGS'].split(' ')))")" >> $GITHUB_ENV;
echo "BUILD_DOCS=$(python3 -c "import os; print(int('BUILD_DOCS' in os.environ['OPTION_FLAGS'].split(' ')))")" >> $GITHUB_ENV;
echo "DEPLOY_DOCS=$(python3 -c "import os; print(int('DEPLOY_DOCS' in os.environ['OPTION_FLAGS'].split(' ')))")" >> $GITHUB_ENV;
echo "USE_PRE=$(python3 -c "import os; print(int('USE_PRE' in os.environ['OPTION_FLAGS'].split(' ')))")" >> $GITHUB_ENV;
- name: Print some Environment variables
run: |
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}"
echo "ENV_DIR: ${ENV_DIR}"
echo "OPTIONAL_DEPS: ${OPTIONAL_DEPS}"
echo "COVERAGE: ${COVERAGE}"
echo "BUILD_DOCS: ${BUILD_DOCS}"
echo "DEPLOY_DOCS: ${DEPLOY_DOCS}"
echo "USE_PRE: ${USE_PRE}"
- name: Start Xvfb
if: startsWith(matrix.os,'ubuntu')
run: |
sudo apt-get install libgl1-mesa-dev xvfb
which Xvfb
Xvfb :99 +extension GLX -screen 0 1024x768x24 2>&1 >/dev/null &
- name: Install dependencies
run: |
bash ci/travis/install.sh
- name: Install FURY and Test it!
run: |
bash ci/travis/script.sh
- name: Upload Coverage
if: ${{ matrix.COVERAGE }} == 1
run: |
coveralls
codecov
- name: Deploy docs
if: success()
if: success() && github.ref == 'refs/heads/master'
run: |
bash ci/travis/deploy_docs.sh
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
feature to the list in README.md.
3. The pull request should work for Python 2.7, 3.4, 3.5, 3.6, 3.7 and for PyPy. Check
https://travis-ci.org/fury-gl/fury/pull_requests
and make sure that the tests pass for all supported Python versions.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include LICENSE
include README.rst
include README.md

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
9 changes: 7 additions & 2 deletions ci/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ cd ${ENV_DIR}

if [ "$INSTALL_TYPE" == "pip" ]; then
PIPI="pip install $EXTRA_PIP_FLAGS"
if [ -n "$USE_PRE" ]; then

$PIPI --upgrade setuptools pip

if [ "$USE_PRE" == "1" ]; then
PIPI="$PIPI $PRE_PIP_FLAGS";
fi
$PIPI --upgrade setuptools pip

$PIPI -r ${TRAVIS_BUILD_DIR}/requirements/default.txt
$PIPI -r ${TRAVIS_BUILD_DIR}/requirements/test.txt
if [[ "${OPTIONAL_DEPS}" == "1" ]]; then
Expand Down Expand Up @@ -51,3 +54,5 @@ else
pip install -r ${TRAVIS_BUILD_DIR}/requirements/docs.txt
fi
fi

set +ev
10 changes: 8 additions & 2 deletions ci/travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ fi
# Install and test FURY
cd ${TRAVIS_BUILD_DIR}
python3 setup.py install
# Change folder
mkdir for_testing
cd for_testing
python3 -c "import fury; print(fury.__version__)"

if [[ "${COVERAGE}" == "1" ]]; then
coverage run -m pytest -svv fury # Run the tests and check for test coverage.
coverage run -m pytest -svv --pyargs fury # Run the tests and check for test coverage.
coverage report -m # Generate test coverage report.
codecov # Upload the report to codecov.
else
pytest -svv fury
pytest -svv --pyargs fury
fi

if [[ "${BUILD_DOCS}" == "1" && "$TRAVIS_OS_NAME" != "osx" ]]; then
# Build the documentation.
# xvfb-run --server-args="-screen 0, 1920x1080x24" \
cd ${TRAVIS_BUILD_DIR}
make -C docs html
fi

set +ev

0 comments on commit 1ef6514

Please sign in to comment.