diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fdca6e6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +on: + pull_request: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: "pnpm" + + - name: Install Node packages + run: pnpm i + + - name: Check code format + run: pnpm check-format + + - name: Run tests + run: pnpm test diff --git a/package.json b/package.json index 0ef51b4..94ec611 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "clean": "rimraf src/*.js src/*.d.ts *.tsbuildinfo", "cmioc": "ts-node src/cli.ts", "format": "prettier --check . --write", + "check-format": "prettier --check .", "prepack": "tsc", "test": "jest" },