Create test.yaml

This commit is contained in:
Daniel Bauer
2024-12-13 18:59:36 +01:00
committed by Daniel Bauer
parent 588c2d33de
commit 6b8c0ea55e
2 changed files with 42 additions and 0 deletions

41
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Build and test project
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
format:
runs-on: ubuntu-latest
name: Check code formatting
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run check-format
build:
runs-on: ubuntu-latest
name: Build project
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run build
test:
runs-on: ubuntu-latest
name: Test project
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm run test

View File

@@ -6,6 +6,7 @@
"scripts": { "scripts": {
"dev": "npx rollup --config rollup.config.js -w", "dev": "npx rollup --config rollup.config.js -w",
"build": "npx rollup --config rollup.config.js --environment BUILD:production", "build": "npx rollup --config rollup.config.js --environment BUILD:production",
"check-format": "npx prettier --check src",
"test": "npx jest", "test": "npx jest",
"version": "node version-bump.mjs && git add manifest.json versions.json", "version": "node version-bump.mjs && git add manifest.json versions.json",
"prepare": "husky" "prepare": "husky"