Skip to content

Commit

Permalink
Workflow scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlemTuzlak committed Apr 8, 2024
1 parent 5f9d3f0 commit cd3c5d1
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 🚀 Validation Pipeline
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
actions: write
contents: read
# Required to put a comment into the pull-request
pull-requests: write
jobs:
lint:
name: ⬣ ESLint
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 20

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🔬 Lint
run: npm run lint:strict

typecheck:
name: 🔎 Type check
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: 🔎 Type check
run: npm run typecheck

vitest:
name: ⚡ Unit Tests
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Install dotenv cli
run: npm install -g dotenv-cli
- name: ⚡ Run vitest
run: npm run test:cov
- name: "Report Coverage"
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm run typecheck && npm run lint
npm run typecheck && npm run lint:strict
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "remix vite:build",
"dev": "remix vite:dev",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"lint:strict": "npm run lint -- --max-warnings 0",
"lint:fix": "npm run lint -- --fix",
"start": "remix-serve ./build/server/index.js",
"test": "vitest run",
Expand Down
2 changes: 2 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default defineConfig({
include: ["./app/**/*.test.{ts,tsx}"],
coverage: {
include: ["app/**/*"],
reporter: ["text", "json-summary", "json"],
reportOnFailure: true,
},
},
});

0 comments on commit cd3c5d1

Please sign in to comment.