Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Update Node support to v16, CI to 18 #182

Merged
merged 3 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ on:
types: [opened, synchronize, reopened]

env:
NODE_VERSION: '14.x'
DEFAULT_NODE_VERSION: 18.x

jobs:
setup:
name: Setup
strategy:
matrix:
node_version: [18.x, 20.x]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
Expand All @@ -29,14 +30,14 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
node-version: '${{ matrix.node_version }}'

- name: Cache node modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{matrix.node_version}}-node_modules-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -45,6 +46,9 @@ jobs:
eslint:
name: Eslint
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18.x, 20.x]
needs: [setup]
timeout-minutes: 5
steps:
Expand All @@ -54,7 +58,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
node-version: '${{ matrix.node_version }}'

- name: Fetch all branches
run: |
Expand All @@ -64,28 +68,31 @@ jobs:
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{matrix.node_version}}-node_modules-${{ hashFiles('package-lock.json') }}

- name: ESLint
run: npm run ci:lint -- $(git diff --diff-filter d --name-only origin/${{ github.base_ref }}...HEAD -- '*.js' '*.ts' '*.tsx')

typescript:
name: Typescript
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18.x, 20.x]
needs: [setup]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
node-version: '${{ matrix.node_version }}'

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{matrix.node_version}}-node_modules-${{ hashFiles('package-lock.json') }}

- name: Typescript
run: npm run ci:tsc
Expand All @@ -94,6 +101,7 @@ jobs:
name: Test
strategy:
matrix:
node_version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: [setup]
Expand All @@ -103,13 +111,13 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
node-version: '${{ matrix.node_version }}'

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{matrix.node_version}}-node_modules-${{ hashFiles('package-lock.json') }}

- name: Test
run: npm run test
Expand All @@ -127,13 +135,13 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
node-version: '${{ env.DEFAULT_NODE_VERSION }}'

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-${{env.DEFAULT_NODE_VERSION}}-node_modules-${{ hashFiles('package-lock.json') }}

- name: Build
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@
}
},
"engines": {
"node": ">=14.0.0"
"node": ">=16.0.0"
}
}
Loading