-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
6,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,123 @@ | ||
name: tests and sonarcloud scan | ||
name: ⚡ Integration checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
types: [opened, ready_for_review, synchronize, converted_to_draft] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
actions: write | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
lint: | ||
name: ⬣ ESLint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: 📦 Setup bun | ||
uses: oven-sh/setup-bun@v2 | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
# Disabling shallow clone is recommended for improving relevancy of reporting | ||
fetch-depth: 0 | ||
node-version-file: '.node-version' | ||
# cache: 'bun' | ||
cache-dependency-path: ./package.json | ||
|
||
- name: 📥 Install deps | ||
run: bun install --frozen-lockfile | ||
|
||
- name: 🔬 Lint | ||
run: bun run lint | ||
|
||
typecheck: | ||
name: ʦ TypeScript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: 📦 Setup bun | ||
uses: oven-sh/setup-bun@v2 | ||
|
||
- name: Caching node_modules | ||
uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
node-version-file: '.node-version' | ||
# cache: 'bun' | ||
cache-dependency-path: ./package.json | ||
|
||
- name: 📥 Install deps | ||
run: bun install --frozen-lockfile | ||
|
||
- name: 🔎 Type check | ||
run: bun run type-check | ||
|
||
test: | ||
name: 🎯 Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
- name: 📦 Setup bun | ||
uses: oven-sh/setup-bun@v2 | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.node-version' | ||
# cache: 'bun' | ||
cache-dependency-path: ./package.json | ||
|
||
- name: 📥 Install deps | ||
run: bun install --frozen-lockfile | ||
|
||
- name: Setting yarn version | ||
run: yarn policies set-version 1.22.19 | ||
- name: 🧪 Tests | ||
run: bun run test:ci | ||
|
||
- name: Install dependencies | ||
run: yarn install --prefer-offline | ||
- name: 💾 Uploading coverage artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lcov | ||
path: ./coverage/lcov.info | ||
|
||
- name: Linting | ||
run: yarn lint | ||
sonar: | ||
name: 🛰️ Sonar | ||
runs-on: ubuntu-latest | ||
needs: [lint, typecheck, test] | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Types check | ||
run: yarn type-check | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Tests | ||
run: yarn test:ci | ||
- name: 👀 Get coverage artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: lcov | ||
path: ./coverage | ||
|
||
- name: SonarCloud Scan | ||
uses: sonarsource/sonarcloud-github-action@master | ||
- name: 📡 SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,23 +7,24 @@ | |
"author": "jpb06 <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"update-deps": "bunx npm-check-updates --root --format group -i", | ||
"prebuild": "rimraf dist", | ||
"build": "yarn build:hiking-app && yarn build:projects-app", | ||
"build": "bun build:hiking-app && bun build:projects-app", | ||
"build:hiking-app": "nest build hiking-app ", | ||
"build:projects-app": "nest build projects-app", | ||
"prisma:gen": "yarn prisma:gen:users && yarn prisma:gen:projects && yarn prisma:gen:hiking", | ||
"prisma:migrate": "yarn prisma:migrate:users && yarn prisma:migrate:projects && yarn prisma:migrate:hiking", | ||
"prisma:gen": "bun prisma:gen:users && bun prisma:gen:projects && bun prisma:gen:hiking", | ||
"prisma:migrate": "bun prisma:migrate:users && bun prisma:migrate:projects && bun prisma:migrate:hiking", | ||
"prisma:gen:users": "prisma generate --schema prisma/users/users-schema.prisma", | ||
"prisma:gen:projects": "prisma generate --schema prisma/projects/projects-schema.prisma", | ||
"prisma:gen:hiking": "prisma generate --schema prisma/hiking/hiking-schema.prisma", | ||
"prisma:migrate:users": "prisma migrate dev --schema prisma/users/users-schema.prisma", | ||
"prisma:migrate:projects": "prisma migrate dev --schema prisma/projects/projects-schema.prisma", | ||
"prisma:migrate:hiking": "prisma migrate dev --schema prisma/hiking/hiking-schema.prisma", | ||
"postinstall": "yarn prisma:gen", | ||
"postinstall": "bun prisma:gen", | ||
"docker": "docker compose down && docker compose up postgres", | ||
"db:seed": "prisma db seed", | ||
"dev": "nest start --watch", | ||
"dev:db": "yarn prisma:migrate && yarn db:seed", | ||
"dev:db": "bun prisma:migrate && bun db:seed", | ||
"start": "nest start", | ||
"start:debug": "nest start --debug --watch", | ||
"start:prod": "node dist/main", | ||
|
@@ -36,7 +37,7 @@ | |
"format": "prettier --write \"apps/**/*.ts\" \"libs/**/*.ts\"", | ||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", | ||
"type-check": "tsc --noEmit", | ||
"sync-icons": "yarn generateReadmeIcons -h 50" | ||
"sync-icons": "bun generateReadmeIcons -h 50" | ||
}, | ||
"dependencies": { | ||
"@nestjs/common": "^10.3.10", | ||
|
@@ -57,8 +58,8 @@ | |
"@nestjs/testing": "^10.3.10", | ||
"@swc/core": "^1.6.13", | ||
"@swc/jest": "^0.2.36", | ||
"@types/dotenv-flow": "^3.2.0", | ||
"@types/express": "^4.17.17", | ||
"@types/dotenv-flow": "^3.3.3", | ||
"@types/express": "^4.17.21", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "^20.14.10", | ||
"@types/supertest": "^6.0.2", | ||
|
@@ -67,28 +68,28 @@ | |
"date-fns": "^3.6.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-jest": "^28.6.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"express": "^4.19.2", | ||
"jest": "^29.5.0", | ||
"jest": "^29.7.0", | ||
"jest-mock-extended": "^3.0.7", | ||
"prettier": "^3.3.3", | ||
"prisma": "^5.16.2", | ||
"readme-package-icons": "^1.1.14", | ||
"rimraf": "^6.0.1", | ||
"source-map-support": "^0.5.21", | ||
"supertest": "^7.0.0", | ||
"ts-loader": "^9.4.3", | ||
"ts-node": "^10.9.1", | ||
"ts-loader": "^9.5.1", | ||
"ts-node": "^10.9.2", | ||
"ts-paths-transform": "^2.0.4", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.5.3", | ||
"webpack": "^5.93.0" | ||
}, | ||
"engines": { | ||
"node": "20.x", | ||
"yarn": "1.22.x" | ||
"bun": "1.1.x" | ||
}, | ||
"prisma": { | ||
"seed": "ts-node prisma/seed.ts" | ||
|
Oops, something went wrong.