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"