Skip to content
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

Setup GitHub Actions for CI #445

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Tests

on: [push]

jobs:
run:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [2.7, 3.6, 3.7]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.8 not available on conda yet


steps:
- uses: actions/checkout@v1

- name: Add conda to $PATH
run: echo ::add-path::$CONDA/condabin

- name: Update conda on Mac
if: matrix.os == 'macos-latest'
run: |
# sudo required?
sudo conda update -y -n base conda setuptools
Comment on lines +24 to +25
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions might be a bit strict with actions. This is what we get without sudo:

NotWritableError: The current user does not have write permissions to a required path.
  path: /Users/runner/.conda/pkgs/urls.txt
  uid: 501
  gid: 20

If you feel that permissions on this path are set incorrectly, you can manually
change them by executing

  $ sudo chown 501:20 /Users/runner/.conda/pkgs/urls.txt

In general, it's not advisable to use 'sudo conda'.


- name: Update conda on Linux
if: matrix.os == 'ubuntu-latest'
run: |
conda update -y -n base conda setuptools

- name: Init conda
run: |
conda init bash
conda info -a

- name: Create the conda environment
run: conda create -q -y -n voila-tests -c conda-forge python=$PYTHON_VERSION pip jupyter_server==0.1.0 jupyterlab_pygments==0.1.0 pytest==3.10.1 nbconvert=5.6 pytest-cov nodejs flake8 ipywidgets matplotlib xeus-cling
env:
PYTHON_VERSION: ${{ matrix.python-version }}

- name: Install dependencies
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate voila-tests
whereis python
python --version

python -m pip install ".[test]"
cd tests/test_template; pip install .; cd ../../;

- name: Flake8
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate voila-tests
python -m flake8 voila tests setup.py

- name: Run tests
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate voila-tests
VOILA_TEST_DEBUG=1 VOILA_TEST_XEUS_CLING=1 py.test tests/ --async-test-timeout=240
voila --help # Making sure we can run `voila --help`