branch: elpa/flycheck
commit bda21d73ed0e5f8618f7b740d452e129d410544b
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Replace Travis CI references with GitHub Actions
The project moved to GitHub Actions long ago but several references to
Travis CI remained in the docs, release script, and test code. Update
all of them: docs now point to GitHub Actions, the release script checks
the GitHub Actions API instead of the Travis API, and the MELPA package
test uses the CI env var instead of TRAVIS. Also remove the stale
Docker-based integration test section from the contributor guide.
---
doc/contributor/contributing.rst | 36 +++---------------------------------
doc/contributor/maintaining.rst | 10 +++++-----
maint/release.py | 22 ++++++++++++++--------
test/specs/test-melpa-package.el | 8 ++++----
4 files changed, 26 insertions(+), 50 deletions(-)
diff --git a/doc/contributor/contributing.rst b/doc/contributor/contributing.rst
index 57d193b673..7b4e1644dc 100644
--- a/doc/contributor/contributing.rst
+++ b/doc/contributor/contributing.rst
@@ -94,36 +94,6 @@ Run ``make help`` to see a list of all available targets.
Some common ones are:
.. _Eask: https://emacs-eask.github.io/
.. _Buttercup: https://github.com/jorgenschaefer/emacs-buttercup
-Running all the integration tests
-=================================
-
-To run all the integration tests, you need to have all the syntax checkers
-installed. As that can be tedious work, and since your locally installed tools
-can have different versions than the tools used on the CI, we have created a
-Docker image with most of the supported checkers. To use the Docker image
-locally and replicate the integration tests that are run on the CI, first you
-need to build the image::
-
- cd flycheck
- docker pull flycheck/emacs-cask:26.2
- docker pull flycheck/all-tools:latest
- docker build --build-arg EMACS_VERSION=26.2 --tag tools-and-emacs:26.2 -f
.travis/tools-and-emacs .
-
-Replace ``26.2`` by the Emacs version you want to test. See the available
-versions on `docker hub`_.
-
-Once the image is built, you can use it to run the integration tests::
-
- docker run --rm -it -v `pwd`:/flycheck --workdir /flycheck
tools-and-emacs:26.2 /bin/bash -c "make integ"
-
-Note that the ``all-tools`` image is rebuilt each month, so the versions of
-its syntax checkers will change accordingly. You can check the version of each
-installed tool by running the ``check-tools`` script in the image::
-
- docker run --rm -it -v `pwd`:/flycheck --workdir /flycheck
tools-and-emacs:26.2 check-tools
-
-.. _docker hub: https://hub.docker.com/r/flycheck/emacs-cask/tags
-
Pull requests
=============
@@ -173,8 +143,8 @@ All pull requests go through a two-stage review process:
Take a look at it to see what we look for in a code review.
-Additionally all pull requests go through automated tests on `Travis CI`_ which
-check code style, run unit tests, etc.
+Additionally all pull requests go through automated tests on `GitHub Actions`_
+which check code style, run tests, etc.
Feel free to mention individual contributors or entire teams
(e.g. ``@flycheck/maintainers`` or ``@flycheck/javascript``) to ask for help or
@@ -188,7 +158,7 @@ may also ask you whether you'd like to join Flycheck and
help us, thus giving
you commit access to our repository and let you merge your own pull request.
.. _pull request reviews:
https://help.github.com/articles/about-pull-request-reviews/
-.. _Travis CI: https://travis-ci.org/flycheck/flycheck/pull_requests
+.. _GitHub Actions: https://github.com/flycheck/flycheck/actions
Writing documentation
=====================
diff --git a/doc/contributor/maintaining.rst b/doc/contributor/maintaining.rst
index 74c4f36848..b8d044f375 100644
--- a/doc/contributor/maintaining.rst
+++ b/doc/contributor/maintaining.rst
@@ -55,7 +55,7 @@ Our workflow implies a couple of rules about which branches
to push code to:
discussion.
* The ``master`` branch is protected. Only :ref:`owners
<flycheck-maintainers>`
can push directly to it. Everyone else needs to open a pull request. Github
- requires maintainer approval and passing Travis CI tests before a pull
request
+ requires maintainer approval and passing CI tests before a pull request
can be merged to master.
.. important::
@@ -187,8 +187,8 @@ extra tooling and some 3rd party services for Flycheck:
* ReadTheDocs_ hosts http://www.flycheck.org and automatically rebuilds it on
every change. It works mostly automatically and requires little
configuration.
-* `Travis CI`_ runs our tests after every push and for every pull request.
- It's configured through ``.travis.yml``.
+* `GitHub Actions`_ runs our tests after every push and for every pull request.
+ It's configured through ``.github/workflows/``.
* `CLA assistant`_ checks signatures to our CLA_ and allows contributors to
sign
the CLA through their Github account.
@@ -197,7 +197,7 @@ these services so in case of an issue just contact them.
.. _Github: https://github.com/flycheck
.. _ReadTheDocs: https://readthedocs.org/projects/flycheck/
-.. _Travis CI: https://travis-ci.org/flycheck/flycheck
+.. _GitHub Actions: https://github.com/flycheck/flycheck/actions
.. _CLA assistant: https://cla-assistant.io
.. _CLA: https://gist.github.com/swsnr/c9c0d656fe7e704da2f734779242ec99
@@ -254,7 +254,7 @@ First, check that
2. your working directory is clean, i.e. has no uncommitted changes or
untracked
files,
3. all commits are pushed,
-4. and Travis CI passes for the latest commit on ``master``.
+4. and CI passes for the latest commit on ``master``.
If all is good a new release is as simple as
diff --git a/maint/release.py b/maint/release.py
index 3e8a16c34f..1aa0e24199 100755
--- a/maint/release.py
+++ b/maint/release.py
@@ -32,7 +32,7 @@ SOURCE_DIR = Path(__file__).resolve().parent.parent
FLYCHECK_EL = SOURCE_DIR.joinpath('flycheck.el')
CHANGELOG = SOURCE_DIR.joinpath('CHANGES.rst')
-TRAVIS_ENDPOINT = 'https://api.travis-ci.org/repos/flycheck/flycheck'
+GITHUB_API = 'https://api.github.com/repos/flycheck/flycheck'
VERSION_HEADER_RE = re.compile(
r'^(?P<label>;;\s*Version:\s*)(?P<value>\S+)\s*$',
@@ -78,12 +78,18 @@ class Version(namedtuple('Version', 'version is_snapshot')):
class BuildState(namedtuple('BuildState', 'commit state')):
@classmethod
- def get_from_travis_ci(cls):
+ def get_from_github_actions(cls):
response = requests.get(
- TRAVIS_ENDPOINT + '/branches/master',
- headers={'Accept': 'application/vnd.travis-ci.2+json'}).json()
- return cls(commit=response['commit']['sha'],
- state=response['branch']['state'])
+ GITHUB_API + '/actions/runs',
+ params={'branch': 'master', 'per_page': 1},
+ headers={'Accept': 'application/vnd.github+json'}).json()
+ if not response.get('workflow_runs'):
+ return cls(commit=None, state='unknown')
+ run = response['workflow_runs'][0]
+ # Map GitHub Actions conclusion to a simple state
+ conclusion = run.get('conclusion', run.get('status', 'unknown'))
+ state = 'passed' if conclusion == 'success' else conclusion
+ return cls(commit=run['head_sha'], state=state)
def read_version_from_library_header(path):
@@ -149,10 +155,10 @@ def ensure_can_make_release(repo):
raise CannotReleaseError(
'Cannot release from dirty working directory.'
' Please commit or stash all changes!')
- state = BuildState.get_from_travis_ci()
+ state = BuildState.get_from_github_actions()
if state.commit != repo.head.ref.object.hexsha:
raise CannotReleaseError(
- 'HEAD not tested on Travis CI.\n'
+ 'HEAD not tested on CI.\n'
'Please push your changes and wait for the build to complete.')
if state.state != 'passed':
raise CannotReleaseError(
diff --git a/test/specs/test-melpa-package.el b/test/specs/test-melpa-package.el
index 77f7615210..70793f32d8 100644
--- a/test/specs/test-melpa-package.el
+++ b/test/specs/test-melpa-package.el
@@ -51,12 +51,12 @@ version."
(describe "MELPA package"
(let* ((directory (make-temp-file "flycheck-test-package" 'directory))
(filename (expand-file-name "flycheck.tar" directory))
- (travis-p (getenv "TRAVIS"))
+ (ci-p (getenv "CI"))
version
entries)
(before-all
- (unless travis-p
+ (unless ci-p
(with-demoted-errors "Failed to obtain Flycheck package: %S"
(setq version (flycheck/get-melpa-version))
@@ -74,8 +74,8 @@ version."
(process-lines "tar" "-tf"
filename))))))))
(before-each
- (assume (not travis-p)
- (concat "Don't test package on Travis CI. "
+ (assume (not ci-p)
+ (concat "Don't test package on CI. "
"Let's not spoil MELPA download stats."))
(assume version "Flycheck MELPA version not found")
(assume entries "Could not download and parse Flycheck package"))