From 6b8c0ea55eebdb65d1626cd3f64082120d864f87 Mon Sep 17 00:00:00 2001 From: Daniel Bauer <4690162+dnlbauer@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:59:36 +0100 Subject: [PATCH] Create test.yaml --- .github/workflows/test.yaml | 41 +++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..0007d1a --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 diff --git a/package.json b/package.json index cb005e1..c3bb8fd 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "npx rollup --config rollup.config.js -w", "build": "npx rollup --config rollup.config.js --environment BUILD:production", + "check-format": "npx prettier --check src", "test": "npx jest", "version": "node version-bump.mjs && git add manifest.json versions.json", "prepare": "husky"