summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
diff options
context:
space:
mode:
authorseth <[email protected]>2023-11-12 03:45:23 -0500
committerseth <[email protected]>2023-11-12 09:02:43 +0000
commit4b498cef6add2e7342a24f7598ed47b32086ae54 (patch)
tree024b7933da35d719accb6db4ed30d7d7ef58c174 /.github/workflows/ci.yaml
parent89089346534f24adabf239317911ef6d1c14f4ea (diff)
feat: use gha to build/deploy
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r--.github/workflows/ci.yaml99
1 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..1d57123
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,99 @@
+name: CI
+
+on:
+ pull_request:
+ workflow_dispatch:
+ workflow_call:
+
+jobs:
+ build:
+ needs: [lint, format]
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: setup pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: install deps
+ run: pnpm install --frozen-lockfile
+
+ - name: run build
+ run: pnpm build
+
+ - name: upload ./dist
+ uses: actions/upload-artifact@v3
+ with:
+ name: dist
+ path: dist
+
+ lint:
+ runs-on: ubuntu-latest
+
+ permissions:
+ security-events: write
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: setup pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: install deps
+ run: pnpm install --frozen-lockfile
+
+ - name: run lint
+ run: pnpm run lint -f @microsoft/eslint-formatter-sarif -o /tmp/lint.sarif
+ continue-on-error: true
+
+ - name: strip suppressed results
+ run: pnpm dlx @ryanccn/sarif-strip-suppressed /tmp/lint.sarif
+
+ - name: upload results
+ uses: github/codeql-action/upload-sarif@v2
+ with:
+ sarif_file: /tmp/lint.sarif
+ wait-for-processing: true
+
+ format:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+
+ - name: setup pnpm
+ uses: pnpm/action-setup@v2
+
+ - name: setup node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: pnpm
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: install deps
+ run: pnpm install --frozen-lockfile
+
+ - name: run prettier
+ run: pnpm exec prettier --check .