Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8 # or your preferred version
version: 8

- name: Get pnpm store directory
id: pnpm-cache
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/ci-app.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/ci-nextjs.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: APP CI

on:
pull_request:
paths:
- 'services/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/**'

permissions:
actions: read
contents: read

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

env:
DEFAULT_NODE_VERSION: '20.13.0'
HUSKY: '0'
NEXT_TELEMETRY_DISABLED: '1'

jobs:
main:
name: 🚀 CI Pipeline
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🔨 Setup Node.js
uses: actions/setup-node@v3
timeout-minutes: 1
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: 📦 Install Dependencies
uses: ./.github/actions/pnpm-install
timeout-minutes: 5

- name: 🔄 Set Nx Base/Head
uses: nrwl/nx-set-shas@v4

- name: 🔑 Create Environment File
timeout-minutes: 1
run: |
echo '${{ secrets.DEV_REACT_APP_CONFIG }}' > config.json
echo '${{ secrets.DEV_ONE_APP_CONFIG }}' | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' > services/one-app/.env
- name: 🔍 Run Type Check
run: pnpm nx-cloud record -- nx affected -t type-check

- name: 📦 Run Build
run: pnpm nx-cloud record -- nx affected -t build

- name: 🧪 Run Tests
run: pnpm nx-cloud record -- nx-cloud record -- nx affected -t test

- name: 💅 Run Lint
run: pnpm nx-cloud record -- nx-cloud record -- nx affected -t lint
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ COPY pnpm-workspace.yaml ./
COPY .nx ./

RUN pnpm install
RUN pnpm install sharp

ENV NEXT_TELEMETRY_DISABLED=1

Expand Down
79 changes: 16 additions & 63 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,43 @@
{
"extends": "nx/presets/npm.json",
"affected": {
"defaultBase": "main"
},
"workspaceLayout": {
"appsDir": "services",
"libsDir": "packages"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"test",
"test:run",
"test:coverage",
"lint",
"lint:fix",
"type-check"
]
}
}
},
"targetDefaults": {
"dev": {
"cache": false,
"persistent": true
},
"build": {
"dependsOn": ["^build", "type-check"],
"outputs": ["{projectRoot}/dist/**"]
},
"start": {
"dependsOn": ["build"],
"cache": false,
"persistent": true
"type-check": {
"cache": true,
"inputs": ["{projectRoot}/**/*.{ts,tsx}", "{projectRoot}/tsconfig.json"]
},
"lint": {
"dependsOn": ["^lint", "type-check"],
"inputs": ["{projectRoot}/**/*.{js,ts,tsx}"]
},
"lint:fix": {
"dependsOn": ["^lint:fix"],
"cache": true,
"inputs": ["{projectRoot}/**/*.{js,ts,tsx}"]
},
"type-check": {
"cache": false,
"inputs": ["{projectRoot}/**/*.{ts,tsx}", "{projectRoot}/tsconfig.json"]
},
"test": {
"build": {
"cache": true,
"dependsOn": ["^build"],
"cache": false,
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"]
"outputs": ["{projectRoot}/dist/**"]
},
"test:run": {
"dependsOn": ["^build"],
"test": {
"cache": true,
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"]
},
"test:coverage": {
"dependsOn": ["^build"],
"cache": true,
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/test/**/*.{js,ts,tsx}"],
"outputs": ["{projectRoot}/coverage/**"]
},
"test:playwright": {
"dependsOn": ["^build"],
"cache": false,
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/e2e/**/*.{js,ts,tsx}"]
},
"test:playwright:ui": {
"dependsOn": ["^build"],
"start": {
"cache": false,
"inputs": ["{projectRoot}/src/**/*.{js,ts,tsx}", "{projectRoot}/e2e/**/*.{js,ts,tsx}"]
"persistent": true,
"dependsOn": ["^build"]
},
"test:all": {
"dependsOn": ["^build", "test:run", "test:playwright"],
"cache": false
"lint:fix": {
"cache": true
}
},
"defaultBase": "main",
"namedInputs": {
"default": ["{projectRoot}/**/*", "!{projectRoot}/**/*.md"],
"production": ["default", "!{projectRoot}/**/*.spec.ts"]
},
"implicitDependencies": {
"**/.env.*local": "*"
}
},
"nxCloudId": "679e791071fd2cb4bf200e60"
}
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"all:build": "nx run-many --target=build --all",
"all:lint": "nx run-many --target=lint --all",
"all:lint:fix": "nx run-many --target=lint:fix --all",
"all:test": "nx run-many --target=test --all",
"all:test:unit": "nx run-many --target=test:run --all",
"all:test:coverage": "nx run-many --target=test:coverage --all",
"all:test:e2e": "nx run-many --target=test:playwright --all",
"all:test:e2e:ui": "nx run-many --target=test:playwright:ui --all"
"all:test": "nx run-many --target=test --all"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
Expand Down
Loading