-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (63 loc) · 1.59 KB
/
test-types.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
name: Test Types
on:
pull_request:
branches:
- main
- 'releases/*'
paths:
- 'types/**'
- '.stoat/**'
- '.github/workflows/test-types.yaml'
push:
branches:
- main
- 'releases/*'
paths:
- 'types/**'
- '.stoat/**'
- '.github/workflows/test-types.yaml'
workflow_dispatch:
inputs:
identifier:
description: 'Arbitrary identifier for the workflow run'
required: true
default: 'default'
defaults:
run:
working-directory: types
jobs:
build:
strategy:
matrix:
node-version: [ 18, 20 ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/types/node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-types-${{ hashFiles('types/yarn.lock') }}
- name: Install dependencies
run: |
yarn install --frozen-lockfile
- name: Generate and build stoat types
run: |
yarn gen-types
yarn build
- name: Ensure no uncommitted changes
run: |
if [ "$(git diff --ignore-space-at-eol ./ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
- name: Run stoat action
uses: ./
if: always()