Skip to content

Commit

Permalink
chore: setup github actions (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBerger committed Jan 29, 2024
1 parent c77bbba commit 9a40128
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PORT=3000
DATABASE_URL="file:./prisma/data.db"
DATABASE_URL="file:./data.db"
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: 🚜 CI
on:
push:
branches:
- main
- dev
pull_request: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: write
contents: read

jobs:
lint:
name: ⬣ ESLint
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

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

- name: 🍞 Setup bun
uses: oven-sh/setup-bun@v1

- name: 📥 Download deps
run: bun install

- name: 🔬 Lint
run: bun run lint

typecheck:
name: ʦ TypeScript
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

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

- name: 🍞 Setup bun
uses: oven-sh/setup-bun@v1

- name: 📥 Download deps
run: bun install

- name: 🔎 Type check
run: bun run typecheck

vitest:
name: ⚡ Vitest
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

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

- name: 🍞 Setup bun
uses: oven-sh/setup-bun@v1

- name: 📥 Download deps
run: bun install

- name: 🏄 Copy test env vars
run: cp .env.example .env

- name: 💎 Setup prisma
run: bun prisma generate

- name: ⚡ Run vitest
run: npm run test -- --coverage
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ come with these default values:
```bash
# Port number
PORT=3000
DATABASE_URL="./prisma/data.db"
DATABASE_URL="./data.db"
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:ui": "vitest --ui",
"coverage": "vitest --coverage",
"start": "bun run build && node dist/src/server.js",
"typecheck": "tsc -p --noEmit --pretty",
"typecheck": "tsc --noEmit --pretty",
"lint": "eslint .",
"format": "prettier -w .",
"build": "tsc",
Expand Down

0 comments on commit 9a40128

Please sign in to comment.