Upgrade dependencies and node version (#233) #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |