Fix types #638
Workflow file for this run
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: ci | |
on: push | |
jobs: | |
prepare: | |
name: Prepare (${{ matrix.os}}, Node ${{ matrix.node }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [18, 20, 22] | |
steps: | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Cache node_modules | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
suite: | |
needs: prepare | |
name: Suite (${{ matrix.os}}, Node ${{ matrix.node }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node: [18, 20, 22] | |
steps: | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Retrieve node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} | |
- name: Lint | |
run: npm run lint | |
- name: Unit | |
run: npm run unit | |
- name: Build | |
run: npm run build | |
- name: Coverage | |
if: matrix.os == 'ubuntu-latest' && matrix.node == 22 | |
uses: codecov/codecov-action@v3 | |
types: | |
needs: prepare | |
name: Types (${{ matrix.os}}, Node ${{ matrix.node }}, TS ${{ matrix.typescript }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node: [22] | |
# Top 5 from https://majors.nullvoxpopuli.com/q?minors=on&packages=typescript | |
# We cannot test 4.9 because it's error throwing is slightly different from v5. | |
typescript: ["5.2", "5.3", "5.4", "5.5", "5.6"] | |
steps: | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Retrieve node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} | |
- name: Overwrite TypeScript | |
run: npm install --no-save typescript@${{ matrix.typescript }} && npx tsc --version | |
- name: Types | |
run: npm run types | |
size: | |
needs: prepare | |
if: github.event_name == 'pull_request' | |
name: Size (${{ matrix.os}}, Node ${{ matrix.node }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node: [22] | |
steps: | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Retrieve node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }} | |
- name: Size | |
uses: andresz1/size-limit-action@v1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |