-
Notifications
You must be signed in to change notification settings - Fork 18
42 lines (37 loc) · 1.12 KB
/
javascript-tests.yml
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
name: JavaScript Tests
on: [push]
jobs:
list-projects:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build-matrix.outputs.result }}
steps:
- uses: actions/checkout@v2
- name: discover all examples
id: build-matrix
uses: actions/github-script@v7
with:
script: |
const { readdirSync, existsSync } = require('node:fs');
const projects = [];
const language = 'javascript';
for (const project of readdirSync(language)) {
if (existsSync(language + '/' + project + '/.tbd-example.json')) {
projects.push(language + '/' + project);
}
}
return projects;
test-javascript:
needs: list-projects
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: ${{ fromJSON(needs.list-projects.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '20.4.0'
- name: Run tests
run: node .github/run-tests.mjs ${{ matrix.project }}