Repository navigation
53 lines (47 loc) · 1.67 KB
/
Copy pathscripts-test.yml
File metadata and controls
53 lines (47 loc) · 1.67 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
52
53
name: Scripts test
# Unit tests for the JavaScript under .github/scripts (Node's built-in runner,
# no dependencies to install), and for the Python helpers under devtools that
# the catalog check scripts report through (the standard library's unittest).
on:
pull_request:
paths:
- '.github/scripts/**'
- 'devtools/**'
- '.github/workflows/scripts-test.yml'
push:
branches: [main]
paths:
- '.github/scripts/**'
- 'devtools/**'
- '.github/workflows/scripts-test.yml'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: .github/scripts
persist-credentials: false
- name: Run tests
# The shell expands the glob, so this works on every Node version.
run: node --test .github/scripts/*.test.js
devtools:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out devtools
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: devtools
persist-credentials: false
- name: Run tests
# A check that passed on its exit code alone, or on its output
# alone, would let the catalog check scripts pass a broken binary.
run: python3 -m unittest discover -s devtools -p '*_test.py' -v