Skip to content

Replace TravisCI with Github Actions #357

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

Merged
merged 1 commit into from
Apr 19, 2021
Merged

Replace TravisCI with Github Actions #357

merged 1 commit into from
Apr 19, 2021

Conversation

dolfinus
Copy link
Contributor

@dolfinus dolfinus commented Apr 18, 2021

TravisCI will soon become dead:
"Please be aware travis-ci.org will be shutting down in several weeks"

Let's move CI to Github Actions. Here is an example of successful workflow: https://github.com/dolfinus/kernel_gateway/actions/runs/761320926

Fixes #354


strategy:
matrix:
python:
Copy link
Contributor Author

@dolfinus dolfinus Apr 18, 2021

Choose a reason for hiding this comment

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

I've removed python3.5 from text matrix because jupyter_client dependency does not support it:
https://travis-ci.org/github/jupyter/kernel_gateway/jobs/766251855

from jupyter_client.channels import HBChannel
  File "/home/travis/virtualenv/python3.5.10/lib/python3.5/site-packages/jupyter_client/channels.py", line 47
    time_to_dead: float = 1.0
                ^
SyntaxError: invalid syntax

This was fixed just recently:
jupyter/jupyter_client@018d8da

So I've synced matrix with supported python versions.

Also because Python2 is not supported by this dependency at all, I've removed every mention from the repo.

- master

jobs:
check_duplicate_runs:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an annoying bug of Github Actions - when someone creates a new branch and pushes some commits here, and then creates a pull request, there are 2 copies of workflow running - one for a push event and another for created PR.

This step prevents the second copy of workflow to be run - if tests are already passed for push event then they will be not run twice while PR is created. Also they will not be run if source code hasn't been changed.

@@ -252,7 +252,7 @@ def test_auth_token(self):
except Exception as ex:
self.assertEqual(ex.code, 401)
else:
self.assert_(False, 'no exception raised')
raise AssertionError('no exception raised')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.assert_ is deprecated, but replacing it with self.assertTrue(False, ...) looks ugly. So I've replaces it with just raising an exception.

@@ -413,13 +413,13 @@ def test_kernel_comm(self):
}))

# Assert the reply comes back. Test will timeout if this hangs.
for _ in range(3):
for _ in range(10):
Copy link
Contributor Author

@dolfinus dolfinus Apr 18, 2021

Choose a reason for hiding this comment

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

Tests were failed with just 3 retries:
https://github.com/dolfinus/kernel_gateway/runs/2374478216?check_suite_focus=true
So I've increased this value.

@@ -92,7 +92,7 @@ def test_ssl_options(self):
self.assertEqual(ssl_options['ssl_version'], 5)

def test_load_notebook_local(self):
nb_path = os.path.join(RESOURCES, 'weirdly?named#notebook.ipynb')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file name causes an error while cloning the repo on a Windows machine - NTFS does not allow to use ? in file names.
So I've renamed it.

ASYNC_TEST_TIMEOUT: 10

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new step is present in jupyter_client CI

@blink1073 blink1073 added this to the 2.5 milestone Apr 19, 2021
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Amazing work, thank you!

@blink1073 blink1073 merged commit 50b26c5 into jupyter-server:master Apr 19, 2021
@kevin-bates
Copy link
Member

Amazing work, thank you!

Yes, agreed - thank you @dolfinus! (Thanks @blink1073 for reviewing this.)

@dolfinus dolfinus deleted the github_actions branch April 19, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move CI from Travis to Github Actions
3 participants