Skip to content

Commit

Permalink
ci: add a GitHub workflow to test a module with CITGM (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and MylesBorins committed Mar 18, 2021
1 parent 59e5a60 commit ae179b5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/nodejs.yml
Expand Up @@ -28,8 +28,6 @@ jobs:
run: npm run lint

test:
name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
Expand All @@ -41,6 +39,7 @@ jobs:
- 10.x
- 12.x
- 14.x
- 15.x

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

Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/test-module.yml
@@ -0,0 +1,62 @@
name: Test a module with CITGM

on:
workflow_dispatch:
inputs:
module:
description: 'Module to test'
required: true
repository:
description: 'CITGM repository to checkout'
required: true
default: nodejs/citgm
ref:
description: 'CITGM GitHub ref to checkout'
required: true
default: main

jobs:
show-parameters:
name: Parameters for testing "${{ github.event.inputs.module }}"

runs-on: ubuntu-latest

steps:
- name: Log workflow parameters
env:
WORKFLOW_PARAMETERS: ${{ toJSON(github.event.inputs) }}
run: echo "$WORKFLOW_PARAMETERS"

test-module:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
node-version:
- 10.x
- 12.x
- 14.x
- 15.x

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

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm install

- name: Run CITGM
run: node bin/citgm.js ${{ github.event.inputs.module }}

0 comments on commit ae179b5

Please sign in to comment.