Skip to content

Commit 421e937

Browse files
authored
feat(workflow): Add commands to support all kind of CI platforms (#150)
* feat(workflow): Add commands to support all kind of CI platforms * changelog * Fix comment title
1 parent a22944f commit 421e937

38 files changed

+308
-33
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
5050
* Move `pkg-file` and `autoloads` commands under `generate` subcommand (#142)
5151
* Add option to convert Cask to Eask (#141 and #145)
5252
* Add command to generate GHA workflow (#141 and #146)
53+
* Add commands to support all kind of CI platforms (#150)
5354

5455
## 0.7.x
5556
> Released Sep 08, 2022
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (C) 2023 Jen-Chieh Shen
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with GNU Emacs; see the file COPYING. If not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301, USA.
18+
*/
19+
20+
"use strict";
21+
22+
exports.command = ['circle-ci [file]'];
23+
exports.desc = 'Generate CircleCI workflow yaml file';
24+
exports.builder = {
25+
file: {
26+
description: 'name of the test file; the default is `config.yml`',
27+
requiresArg: false,
28+
type: 'array',
29+
group: TITLE_CMD_OPTION,
30+
},
31+
};
32+
33+
exports.handler = async (argv) => {
34+
await UTIL.e_call(argv, 'generate/workflow/circle-ci', argv.file);
35+
};
36+

cmds/generate/workflow/github.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
"use strict";
2121

22-
exports.command = ['github [file]'];
22+
exports.command = ['github [file]', 'github-actions [file]', 'gha [file]'];
2323
exports.desc = 'Generate GitHub Actions workflow yaml file';
2424
exports.builder = {
2525
file: {

cmds/generate/workflow/gitlab.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (C) 2023 Jen-Chieh Shen
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with GNU Emacs; see the file COPYING. If not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301, USA.
18+
*/
19+
20+
"use strict";
21+
22+
exports.command = ['gitlab [file]', 'gitlab-runner [file]'];
23+
exports.desc = 'Generate GitLab Runner workflow yaml file';
24+
exports.builder = {
25+
file: {
26+
description: 'name of the test file; the default is `.gitlab-ci.yml`',
27+
requiresArg: false,
28+
type: 'array',
29+
group: TITLE_CMD_OPTION,
30+
},
31+
};
32+
33+
exports.handler = async (argv) => {
34+
await UTIL.e_call(argv, 'generate/workflow/gitlab', argv.file);
35+
};
36+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (C) 2023 Jen-Chieh Shen
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with GNU Emacs; see the file COPYING. If not, write to the
16+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17+
* Boston, MA 02110-1301, USA.
18+
*/
19+
20+
"use strict";
21+
22+
exports.command = ['travis-ci [file]'];
23+
exports.desc = 'Generate Travis CI workflow yaml file';
24+
exports.builder = {
25+
file: {
26+
description: 'name of the test file; the default is `.travis.yml`',
27+
requiresArg: false,
28+
type: 'array',
29+
group: TITLE_CMD_OPTION,
30+
},
31+
};
32+
33+
exports.handler = async (argv) => {
34+
await UTIL.e_call(argv, 'generate/workflow/travis-ci', argv.file);
35+
};
36+

docs/content/en/Continuous Integration/CircleCI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ default: &default-steps
1414
- checkout
1515
- run: apt-get update && apt-get install -y git
1616
- run: |
17+
eask package
1718
eask install
1819
eask compile
19-
eask lint package
2020
2121
# Enumerated list of Emacs versions
2222
jobs:

docs/content/en/Continuous Integration/GitHub Actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131

3232
- name: Run tests
3333
run: |
34+
eask package
3435
eask install
3536
eask compile
36-
eask lint package
3737
```
3838
3939
This example is testing your Emacs Lisp package in the below environment;

docs/content/en/Continuous Integration/GitLab Runner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ pages:
1818
- apt-get update
1919
- apt-get install emacs -y
2020
script:
21+
- eask package
2122
- eask install
2223
- eask compile
23-
- eask lint package
2424
only:
2525
- main
2626
```

docs/content/en/Continuous Integration/Travis CI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ install:
2525
- npm install @emacs-eask/cli -g
2626

2727
script:
28+
- eask package
2829
- eask install
2930
- eask compile
30-
- eask lint package
3131
```
3232
3333
This example is testing your Emacs Lisp package in the below environment;

docs/content/en/Getting Started/Commands and options.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,44 @@ $ eask [GLOBAL-OPTIONS] generate pkg-file
331331
[Multi-file Packages (elisp)](https://www.gnu.org/software/emacs/manual/html_node/elisp/Multi_002dfile-Packages.html#Multi_002dfile-Packages)
332332
for details.
333333

334+
## 🔍 eask generate workflow circle-ci
335+
336+
Generate CircleCI workflow yaml file.
337+
338+
```sh
339+
$ eask [GLOBAL-OPTIONS] generate workflow circle-ci [--file]
340+
```
341+
342+
{{< hint info >}}
343+
💡 This will generate the yaml file under `.circleci/`!
344+
{{< /hint >}}
345+
334346
## 🔍 eask generate workflow github
335347

336348
Generate GitHub Actions workflow yaml file.
337349

338350
```sh
339-
$ eask [GLOBAL-OPTIONS] generate workflow github
351+
$ eask [GLOBAL-OPTIONS] generate workflow github [--file]
352+
```
353+
354+
{{< hint info >}}
355+
💡 This will generate the yaml file under `.github/workflow/`!
356+
{{< /hint >}}
357+
358+
## 🔍 eask generate workflow gitlab
359+
360+
Generate GitLab Runner workflow yaml file.
361+
362+
```sh
363+
$ eask [GLOBAL-OPTIONS] generate workflow gitlab [--file]
364+
```
365+
366+
## 🔍 eask generate workflow travis-ci
367+
368+
Generate Travis CI workflow yaml file.
369+
370+
```sh
371+
$ eask [GLOBAL-OPTIONS] generate workflow travis-ci [--file]
340372
```
341373

342374
# 🚩 Linking

0 commit comments

Comments
 (0)