Skip to content

Commit f333997

Browse files
committed
Replace TravisCI with Github Actions
1 parent 71f7093 commit f333997

21 files changed

+166
-847
lines changed

.github/workflows/tests.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
check_duplicate_runs:
11+
name: Check for duplicate runs
12+
continue-on-error: true
13+
runs-on: ubuntu-latest
14+
outputs:
15+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
16+
steps:
17+
- id: skip_check
18+
uses: fkirc/skip-duplicate-actions@master
19+
with:
20+
concurrent_skipping: always
21+
cancel_others: true
22+
skip_after_successful_duplicate: true
23+
paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/LICENSE.md"]'
24+
do_not_skip: '["pull_request"]'
25+
26+
tests:
27+
name: Run tests (Python ${{matrix.python}})
28+
needs: check_duplicate_runs
29+
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}
30+
31+
strategy:
32+
matrix:
33+
python:
34+
- "3.6"
35+
- "3.6"
36+
- "3.7"
37+
- "3.8"
38+
- "3.9"
39+
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v2
48+
with:
49+
python-version: ${{ matrix.python }}
50+
51+
- name: Cache pip
52+
uses: actions/cache@v2
53+
with:
54+
path: ~/.cache/pip
55+
key: ${{ runner.os }}-python-${{ matrix.python }}-pip-${{ hashFiles('**/requirements*.txt') }}
56+
restore-keys: |
57+
${{ runner.os }}-python-${{ matrix.python }}-pip-${{ hashFiles('**/requirements*.txt') }}
58+
${{ runner.os }}-python-${{ matrix.python }}-pip-
59+
${{ runner.os }}-python
60+
${{ runner.os }}-
61+
62+
- name: Upgrade pip
63+
run: python -m pip install --upgrade pip setuptools wheel
64+
65+
- name: Install dependencies
66+
run: |
67+
pip install --upgrade -r requirements.txt -r requirements-test.txt
68+
pip install -e .
69+
pip freeze
70+
71+
- name: Show help
72+
run: jupyter kernelgateway --help
73+
74+
- name: Run tests
75+
run: nosetests --process-restartworker --with-coverage --cover-package=kernel_gateway
76+
env:
77+
ASYNC_TEST_TIMEOUT: 10
78+
79+
- name: Upload coverage to Codecov
80+
uses: codecov/codecov-action@v1
81+
with:
82+
fail_ci_if_error: true

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https://groups.google.com/forum/#!forum/jupyter)
44
[![PyPI version](https://badge.fury.io/py/jupyter_kernel_gateway.svg)](https://badge.fury.io/py/jupyter_kernel_gateway)
5-
[![Build Status](https://travis-ci.org/jupyter/kernel_gateway.svg?branch=master)](https://travis-ci.org/jupyter/kernel_gateway)
5+
[![Build Status](https://github.com/jupyter/kernel_gateway/workflows/Tests/badge.svg)](https://github.com/jupyter/kernel_gateway/actions?query=workflow%3ATests)
66
[![Documentation Status](http://readthedocs.org/projects/jupyter-kernel-gateway/badge/?version=latest)](https://jupyter-kernel-gateway.readthedocs.io/en/latest/?badge=latest)
77

88
## Overview
@@ -42,7 +42,7 @@ documentation for a list of the Jupyter Kernel Gateway features.
4242

4343
## Installation
4444

45-
Detailed installation instructions are located in the
45+
Detailed installation instructions are located in the
4646
[Getting Started page](https://jupyter-kernel-gateway.readthedocs.io/en/latest/getting-started.html)
4747
of the project docs. Here's a quick start using `pip`:
4848

kernel_gateway/tests/notebook_http/swagger/test_parser.py

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""Tests for notebook cell parsing."""
44

55
import unittest
6-
import sys
76
from kernel_gateway.notebook_http.swagger.parser import SwaggerCellParser
87

98

@@ -142,51 +141,48 @@ def test_endpoint_response_concatenation(self):
142141
self.assertEqual(endpoints['/foo/:bar']['get'], '# ResponseInfo operationId: get\n')
143142

144143
def test_undeclared_operations(self):
145-
if sys.version_info[:2] >= (3,4):
146-
"""Parser should warn about operations that aren't documented in the
147-
swagger cell
148-
"""
149-
source_cells = [
150-
{"source":'```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
151-
{"source":'# operationId: get'},
152-
{"source":'# operationId: postbar '},
153-
{"source":'# operationId: putbar'},
154-
{"source":'# operationId: extraOperation'},
155-
]
156-
with self.assertLogs(level='WARNING') as warnings:
157-
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
158-
for output in warnings.output:
159-
self.assertRegex(output, 'extraOperation')
144+
"""Parser should warn about operations that aren't documented in the
145+
swagger cell
146+
"""
147+
source_cells = [
148+
{"source":'```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
149+
{"source":'# operationId: get'},
150+
{"source":'# operationId: postbar '},
151+
{"source":'# operationId: putbar'},
152+
{"source":'# operationId: extraOperation'},
153+
]
154+
with self.assertLogs(level='WARNING') as warnings:
155+
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
156+
for output in warnings.output:
157+
self.assertRegex(output, 'extraOperation')
160158

161159
def test_undeclared_operations_reversed(self):
162-
if sys.version_info[:2] >= (3,4):
163-
"""Parser should warn about operations that aren't documented in the
164-
swagger cell
165-
"""
166-
source_cells = [
167-
{"source":'# operationId: get'},
168-
{"source":'# operationId: postbar '},
169-
{"source":'# operationId: putbar'},
170-
{"source":'# operationId: extraOperation'},
171-
{"source":'```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
172-
]
173-
with self.assertLogs(level='WARNING') as warnings:
174-
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
175-
for output in warnings.output:
176-
self.assertRegex(output, 'extraOperation')
160+
"""Parser should warn about operations that aren't documented in the
161+
swagger cell
162+
"""
163+
source_cells = [
164+
{"source":'# operationId: get'},
165+
{"source":'# operationId: postbar '},
166+
{"source":'# operationId: putbar'},
167+
{"source":'# operationId: extraOperation'},
168+
{"source":'```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
169+
]
170+
with self.assertLogs(level='WARNING') as warnings:
171+
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
172+
for output in warnings.output:
173+
self.assertRegex(output, 'extraOperation')
177174

178175
def test_unreferenced_operations(self):
179-
if sys.version_info[:2] >= (3,4):
180-
"""Parser should warn about documented operations that aren't referenced
181-
in a cell
182-
"""
183-
source_cells = [
184-
{"source": '```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
185-
{"source": '# operationId: get'},
186-
{"source": '# operationId: putbar'},
187-
{"source": '# operationId: putbar '}
188-
]
189-
with self.assertLogs(level='WARNING') as warnings:
190-
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
191-
for output in warnings.output:
192-
self.assertRegex(output, 'postbar')
176+
"""Parser should warn about documented operations that aren't referenced
177+
in a cell
178+
"""
179+
source_cells = [
180+
{"source": '```\n{"swagger":"2.0", "paths": {"/foo": {"put": {"operationId":"putbar","parameters": [{"name": "bar"}]},"post":{"operationId":"postbar"},"get": {"operationId":"get","parameters": [{"name": "bar"}]}}}}\n```\n'},
181+
{"source": '# operationId: get'},
182+
{"source": '# operationId: putbar'},
183+
{"source": '# operationId: putbar '}
184+
]
185+
with self.assertLogs(level='WARNING') as warnings:
186+
SwaggerCellParser(comment_prefix='#', notebook_cells=source_cells)
187+
for output in warnings.output:
188+
self.assertRegex(output, 'postbar')

kernel_gateway/tests/resources/failing_code2.ipynb

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)