Skip to content

Commit cd3c5d1

Browse files
committed
Workflow scripts
1 parent 5f9d3f0 commit cd3c5d1

4 files changed

Lines changed: 85 additions & 1 deletion

File tree

.github/workflows/validate.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: 🚀 Validation Pipeline
2+
concurrency:
3+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
permissions:
11+
actions: write
12+
contents: read
13+
# Required to put a comment into the pull-request
14+
pull-requests: write
15+
jobs:
16+
lint:
17+
name: ⬣ ESLint
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 🛑 Cancel Previous Runs
21+
uses: styfle/cancel-workflow-action@0.11.0
22+
23+
- name: ⬇️ Checkout repo
24+
uses: actions/checkout@v3
25+
26+
- name: ⎔ Setup node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 20
30+
31+
- name: 📥 Download deps
32+
uses: bahmutov/npm-install@v1
33+
with:
34+
useLockFile: false
35+
36+
- name: 🔬 Lint
37+
run: npm run lint:strict
38+
39+
typecheck:
40+
name: 🔎 Type check
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: 🛑 Cancel Previous Runs
44+
uses: styfle/cancel-workflow-action@0.11.0
45+
- name: ⬇️ Checkout repo
46+
uses: actions/checkout@v3
47+
- name: ⎔ Setup node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 20
51+
- name: 📥 Download deps
52+
uses: bahmutov/npm-install@v1
53+
with:
54+
useLockFile: false
55+
- name: 🔎 Type check
56+
run: npm run typecheck
57+
58+
vitest:
59+
name: ⚡ Unit Tests
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: 🛑 Cancel Previous Runs
63+
uses: styfle/cancel-workflow-action@0.11.0
64+
- name: ⬇️ Checkout repo
65+
uses: actions/checkout@v3
66+
- name: ⎔ Setup node
67+
uses: actions/setup-node@v3
68+
with:
69+
node-version: 20
70+
- name: 📥 Download deps
71+
uses: bahmutov/npm-install@v1
72+
with:
73+
useLockFile: false
74+
- name: Install dotenv cli
75+
run: npm install -g dotenv-cli
76+
- name: ⚡ Run vitest
77+
run: npm run test:cov
78+
- name: "Report Coverage"
79+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
80+
if: always()
81+
uses: davelosert/vitest-coverage-report-action@v2

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run typecheck && npm run lint
1+
npm run typecheck && npm run lint:strict

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"build": "remix vite:build",
1313
"dev": "remix vite:dev",
1414
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
15+
"lint:strict": "npm run lint -- --max-warnings 0",
1516
"lint:fix": "npm run lint -- --fix",
1617
"start": "remix-serve ./build/server/index.js",
1718
"test": "vitest run",

vitest.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export default defineConfig({
1010
include: ["./app/**/*.test.{ts,tsx}"],
1111
coverage: {
1212
include: ["app/**/*"],
13+
reporter: ["text", "json-summary", "json"],
14+
reportOnFailure: true,
1315
},
1416
},
1517
});

0 commit comments

Comments
 (0)