From 3a9a36582f12e720c0265524c85e77e6f1bc2af4 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 18 Nov 2020 05:24:13 +0100 Subject: [PATCH] Migrate tests from travis to GitHub Actions --- .github/workflows/test.yaml | 62 +++++++++++++++++++++++++++++++++++++ .travis.yml | 14 --------- 2 files changed, 62 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..3555d7a5 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,62 @@ +# This is a GitHub workflow defining a set of jobs with a set of steps. +# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions +# +name: Test + +# Trigger the workflow's on all PRs but only on pushed tags or commits to +# main/master branch to avoid PRs developed in a GitHub fork's dedicated branch +# to trigger. +on: + pull_request: + push: + branches: + tags: + workflow_dispatch: + +defaults: + run: + # Declare bash be used by default in this workflow's "run" steps. + # + # NOTE: bash will by default run with: + # --noprofile: Ignore ~/.profile etc. + # --norc: Ignore ~/.bashrc etc. + # -e: Exit directly on errors + # -o pipefail: Don't mask errors from a command piped into another command + shell: bash + +jobs: + test: + runs-on: ubuntu-20.04 + + strategy: + # Keep running even if one variation of the job fail + fail-fast: false + matrix: + # We run this job multiple times with different parameterization + # specified below, these parameters have no meaning on their own and + # gain meaning on how job steps use them. + include: + - python: 3.5 + - python: 3.6 + - python: 3.7 + - python: 3.8 + - python: 3.9 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "${{ matrix.python }}" + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install . + pip install pytest + pip freeze + + - name: Run tests + run: | + JUPYTER_TOKEN=secret jupyter-notebook --config=./tests/resources/jupyter_server_config.py & + sleep 5 + pytest --verbose --color=yes diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 677d9abc..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: -- 3.5 -- 3.6 -- 3.7 -- 3.8 - -install: - - pip3 install . - - pip3 install pytest -script: - - JUPYTER_TOKEN=secret jupyter-notebook --config=./tests/resources/jupyter_server_config.py & - - sleep 5 - - pytest -v