-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (49 loc) · 1.44 KB
/
reusable-typescript-test.yml
File metadata and controls
51 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Reusable TypeScript Testing Workflow
on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
node-versions:
description: 'JSON array of Node.js versions to test against'
required: false
type: string
default: '["16", "18"]'
platforms:
description: 'JSON array of platforms to run tests on'
required: false
type: string
default: '["ubuntu-latest"]'
test-script:
description: 'Test script to execute'
required: false
type: string
default: './run-tests.sh'
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
jobs:
test:
strategy:
matrix:
node-version: ${{ fromJSON(inputs.node-versions) }}
platform: ${{ fromJSON(inputs.platforms) }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
with:
repository: DataDog/datadog-api-client-typescript
ref: ${{ inputs.target-branch || github.ref }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Test
run: ${{ inputs.test-script }}
shell: bash