Skip to content

Commit 3a9a325

Browse files
authored
ci: add a GitHub workflow to test a module with CITGM (#849)
1 parent d0185d9 commit 3a9a325

2 files changed

Lines changed: 63 additions & 2 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
run: npm run lint
2929

3030
test:
31-
name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
32-
3331
strategy:
3432
fail-fast: false
3533
matrix:
@@ -41,6 +39,7 @@ jobs:
4139
- 10.x
4240
- 12.x
4341
- 14.x
42+
- 15.x
4443

4544
runs-on: ${{ matrix.os }}
4645

.github/workflows/test-module.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Test a module with CITGM
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
module:
7+
description: 'Module to test'
8+
required: true
9+
repository:
10+
description: 'CITGM repository to checkout'
11+
required: true
12+
default: nodejs/citgm
13+
ref:
14+
description: 'CITGM GitHub ref to checkout'
15+
required: true
16+
default: main
17+
18+
jobs:
19+
show-parameters:
20+
name: Parameters for testing "${{ github.event.inputs.module }}"
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Log workflow parameters
26+
env:
27+
WORKFLOW_PARAMETERS: ${{ toJSON(github.event.inputs) }}
28+
run: echo "$WORKFLOW_PARAMETERS"
29+
30+
test-module:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os:
35+
- macos-latest
36+
- ubuntu-latest
37+
- windows-latest
38+
node-version:
39+
- 10.x
40+
- 12.x
41+
- 14.x
42+
- 15.x
43+
44+
runs-on: ${{ matrix.os }}
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v2
49+
with:
50+
repository: ${{ github.event.inputs.repository }}
51+
ref: ${{ github.event.inputs.ref }}
52+
53+
- name: Use Node.js ${{ matrix.node-version }}
54+
uses: actions/setup-node@v2
55+
with:
56+
node-version: ${{ matrix.node-version }}
57+
58+
- name: Install packages
59+
run: npm install
60+
61+
- name: Run CITGM
62+
run: node bin/citgm.js ${{ github.event.inputs.module }}

0 commit comments

Comments
 (0)