Skip to content

Commit

Permalink
chore: add new CI steps
Browse files Browse the repository at this point in the history
  • Loading branch information
daleal committed May 10, 2024
1 parent 618d4bf commit 67b6da2
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: build

on:
pull_request:
paths:
- ".github/workflows/build.yml"
- "src/**"
- "tsconfig.json"
- "tsconfig.module.json"
- "vite.config.ts"
- "package.json"
- "package-lock.json"

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2

- name: Set up Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20.9.0'
registry-url: https://registry.npmjs.org

# Cache the node_modules directory
- name: Set up node_modules cache
uses: actions/cache@v2
id: node-modules-cache
with:
key: node-modules-cache-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Run build
run: npm run build
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: test

on:
pull_request:
paths:
- ".github/workflows/test.yml"
- "src/**"
- "tsconfig.build.json"
- "tsconfig.json"
- "tsconfig.module.json"
- "vite.config.ts"
- "package.json"
- "package-lock.json"

jobs:
vitest:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2

- name: Set up Node.js v20
uses: actions/setup-node@v4
with:
node-version: '20.9.0'
registry-url: https://registry.npmjs.org

# Cache the node_modules directory
- name: Set up node_modules cache
uses: actions/cache@v2
id: node-modules-cache
with:
key: node-modules-cache-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Run tests
run: npm run test

0 comments on commit 67b6da2

Please sign in to comment.