Pārlūkot izejas kodu

Switch from TravisCI to Github Actions

This is necessary since Travis's free tier is going away soon. One
minor regression is that coverage is only profiled for one Emacs
version instead of all, since undercover.el doesn't seem to support
parallel jobs outside of Travis.

This commit also switches to eldev's new built-in support for
undercover, removing the custom code I had written previously.
Ryan C. Thompson 4 gadi atpakaļ
vecāks
revīzija
f91e5a1d69
4 mainītis faili ar 59 papildinājumiem un 49 dzēšanām
  1. 57 0
      .github/workflows/test.yml
  2. 0 36
      .travis.yml
  3. 0 11
      001-setup-undercover.el
  4. 2 2
      Eldev

+ 57 - 0
.github/workflows/test.yml

@@ -0,0 +1,57 @@
+name: CI
+
+on:
+  push:
+    paths-ignore:
+      - '**.md'
+  pull_request:
+    paths-ignore:
+      - '**.md'
+
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        emacs_version:
+          - 27.1
+          - 26.3
+          - 26.2
+          - 26.1
+          - 25.3
+          - 25.2
+          - 25.1
+          - 24.5
+          - 24.4
+          - snapshot
+    env:
+      # We only generate a coverage report for one Emacs version
+      # (generally the latest release version) in order to avoid
+      # duplicate reports.
+      coveralls_emacs_version: 27.1
+    steps:
+    - name: Set up Emacs
+      uses: purcell/setup-emacs@master
+      with:
+        version: ${{matrix.emacs_version}}
+
+    - name: Install Eldev
+      run: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev | sh
+
+    - name: Check out the source code
+      uses: actions/checkout@v2
+
+    - name: Install Elisp dependencies
+      run: eldev prepare test
+
+    - name: Run the test suite
+      run: |
+        eldev -p -dtT test
+
+    - name: Run the test suite in source mode (for undercover)
+      if: ${{ matrix.emacs_version == env.coveralls_emacs_version }}
+      env:
+        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
+      run: |
+        eldev -s -dtT test

+ 0 - 36
.travis.yml

@@ -1,36 +0,0 @@
-language: nix
-
-env:
-  matrix:
-    - EMACS_CI=emacs-24-4
-    - EMACS_CI=emacs-24-5
-    - EMACS_CI=emacs-25-1
-    - EMACS_CI=emacs-25-2
-    - EMACS_CI=emacs-25-3
-    - EMACS_CI=emacs-26-1
-    - EMACS_CI=emacs-26-2
-    - EMACS_CI=emacs-26-3
-    - EMACS_CI=emacs-snapshot
-
-matrix:
-  allow_failures:
-  - env: EMACS_CI=emacs-snapshot
-
-before_script:
-  # travis-wait-enhanced
-  - |
-    wget -qO- "https://github.com/crazy-max/travis-wait-enhanced/releases/download/v1.1.0/travis-wait-enhanced_1.1.0_linux_x86_64.tar.gz" | tar -zxvf - travis-wait-enhanced
-    mv travis-wait-enhanced /home/travis/bin/
-    travis-wait-enhanced --version
-  # Install nix-emacs-ci
-  - bash <(curl https://raw.githubusercontent.com/purcell/nix-emacs-ci/master/travis-install)
-  # Install Eldev
-  - curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/travis-eldev > x.sh && source ./x.sh
-  # Install elisp dependencies
-  - eldev prepare test
-
-script:
-  # Run flx-ido tests in source mode for undercover's benefit
-  - travis-wait-enhanced --timeout=3m -- eldev -s -dtT -S '(load-file "Eldev-flx-ido")' test
-  # Packaged mode, don't run undercover or flx-ido
-  - travis-wait-enhanced --timeout=3m -- eldev -p -dtT test

+ 0 - 11
001-setup-undercover.el

@@ -1,11 +0,0 @@
-;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
-
-
-(when (version< emacs-version "27")
-  (when (featurep 'ido-completing-read+)
-    (error "Undercover loaded too late"))
-  (message "Setting up undercover")
-  (require 'undercover)
-  (defadvice undercover--edebug-files (before echo-instrumented-files activate)
-    (message "Undercover instrumenting the following files: %S" files))
-  (undercover "ido-completing-read+.el"))

+ 2 - 2
Eldev

@@ -1,5 +1,7 @@
 ;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
 
+(eldev-use-plugin 'undercover)
+
 (eldev-use-package-archive 'gnu)
 (eldev-use-package-archive 'melpa-unstable)
 
@@ -11,8 +13,6 @@
 (eldev-add-extra-dependencies 'test 'flx-ido)
 (eldev-add-extra-dependencies 'test 'with-simulated-input)
 (eldev-add-extra-dependencies 'test 's)
-(when (version< emacs-version "27")
-  (eldev-add-extra-dependencies 'test 'undercover))
 
 ;; Tell checkdoc not to demand two spaces after a period.
 (setq sentence-end-double-space nil)