Skip to content

Open-source status page, incident response and uptime monitoring

Add GitHub actions (#70)

Kelvin Amoaba2820f3437695
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 000000000..88ecdabe4
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,69 @@
+# https://github.com/kentcdodds/kentcdodds.com/blob/main/.github/workflows/deployment.yml
+name: Code Check
+on:
+ push:
+ branches:
+ - "*"
+ pull_request: {}
+
+concurrency:
+ group: ${{ github.job }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ lint:
+ name: ⬣ ESLint
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ steps:
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v3
+
+ - name: Set up pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Setup node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: "pnpm"
+
+ - name: 📥 Download deps
+ run: pnpm install
+
+ - name: 🔬 Lint
+ run: pnpm lint:strict
+
+ prettier:
+ name: 💅 Prettier
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+
+ env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ steps:
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v3
+
+ - name: Set up pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Setup node
+ uses: actions/setup-node@v3
+ with:
+ node-version: 18
+ cache: "pnpm"
+
+ - name: 📥 Download deps
+ run: pnpm install
+
+ - name: 💅 Prettier check
+ run: pnpm prettier
diff --git a/package.json b/package.json
index 8fa6591c8..238162189 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,9 @@
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
+ "lint:strict": "eslint --max-warnings=0 apps/**/*.{ts,tsx}",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
+ "format:check": "prettier -c \"**/*.{ts,tsx,md}\"",
"tsc": "tsc"
},
"pnpm": {
@@ -30,4 +32,4 @@
},
"packageManager": "[email protected]",
"name": "openstatus"
-}
+}
\ No newline at end of file