Skip to content

Commit f7acb47

Browse files
committed
test: Add activation test for standalone CLI
1 parent b73630b commit f7acb47

File tree

7 files changed

+138
-0
lines changed

7 files changed

+138
-0
lines changed

.github/workflows/activation-cli.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Activation CLI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os:
21+
- ubuntu-latest
22+
- macos-latest
23+
- windows-latest
24+
emacs-version:
25+
- 27.2
26+
- 28.2
27+
- snapshot
28+
include:
29+
- emacs-version: 'snapshot'
30+
allow_failure: true
31+
steps:
32+
- uses: jcs090218/setup-emacs@master
33+
with:
34+
version: ${{ matrix.emacs-version }}
35+
36+
# Remove expired DST Root CA X3 certificate. Workaround for
37+
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
38+
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
39+
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
40+
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
41+
run: |
42+
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
43+
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
44+
45+
- uses: emacs-eask/setup-eask@master
46+
with:
47+
version: 'snapshot'
48+
49+
- uses: actions/checkout@v3
50+
51+
- name: Grant execution permission
52+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
53+
run: chmod -R 777 ./tests/fixtures/dummy-package/
54+
55+
- name: Run tests
56+
run: |
57+
./tests/fixtures/dummy-package/run.sh

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
test:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
21+
fail-fast: false
2122
matrix:
2223
os:
2324
- ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.cask
22
/.eask
3+
/dist
34
/.elsa
45
/tests/.elsa
56
*.elc
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.eask
2+
/dist
3+
4+
/.elsa
5+
/tests/.elsa
6+
7+
*.elc
8+
report.json
9+
.dir-locals.el
10+
.env

tests/fixtures/dummy-package/Eask

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(package "dummy-package"
2+
"0.1.0"
3+
"Dummy package test")
4+
5+
(package-file "dummy-package.el")
6+
7+
(script "test" "echo \"Error: no test specified\" && exit 1")
8+
9+
(source 'gnu)
10+
(source 'melpa)
11+
12+
(depends-on "emacs" "26.1")
13+
(depends-on "dash" "2.14")
14+
(depends-on "seq")
15+
(depends-on "f")
16+
(depends-on "trinary")
17+
(depends-on "lsp-mode")
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
;;; dummy-package.el --- Dummy package main file -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2023 Shen, Jen-Chieh
4+
5+
;; Author: Shen, Jen-Chieh <[email protected]>
6+
;; Maintainer: Shen, Jen-Chieh <[email protected]>
7+
;; URL: https://github.com/emacs-elsa/dummy-package
8+
;; Version: 0.1.0
9+
;; Package-Requires: ((emacs "25.1"))
10+
;; Keywords: internal dummy tests
11+
12+
;; This file is not part of GNU Emacs.
13+
14+
;; This program is free software: you can redistribute it and/or modify
15+
;; it under the terms of the GNU General Public License as published by
16+
;; the Free Software Foundation, either version 3 of the License, or
17+
;; (at your option) any later version.
18+
19+
;; This program is distributed in the hope that it will be useful,
20+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
;; GNU General Public License for more details.
23+
24+
;; You should have received a copy of the GNU General Public License
25+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
26+
27+
;;; Commentary:
28+
;;
29+
;; Test for stand-alone analysis from CLI
30+
;;
31+
32+
;;; Code:
33+
34+
35+
36+
(provide 'dummy-package)
37+
;;; dummy-package.el ends here

tests/fixtures/dummy-package/run.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
cd $(dirname "$0")
4+
5+
# Test MELPA version
6+
echo "Testing packaged version from MELPA..."
7+
eask clean all
8+
eask install elsa
9+
eask exec elsa dummy-package.el
10+
11+
# Test development version
12+
echo "Testing development version via eask link..."
13+
eask clean all
14+
eask link add elsa "../../../"
15+
eask exec elsa dummy-package.el

0 commit comments

Comments
 (0)