Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(eng-4792): speed up CI

Tre Dubrava4ff3fb4a1830
diff --git a/.github/workflows/check-be-ts-and-lint.yml b/.github/workflows/check-be-ts-and-lint.yml
index c0c5796048..aa10cdd7fb 100644
--- a/.github/workflows/check-be-ts-and-lint.yml
+++ b/.github/workflows/check-be-ts-and-lint.yml
@@ -10,26 +10,62 @@ on:
- "backend/.eslintrc.js"
jobs:
- check-be-pr:
- name: Check TS and Lint
+ type-check:
+ name: Type Check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: ☁️ Checkout source
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: 🔧 Setup Node 22
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: "22"
- cache: "npm"
- cache-dependency-path: backend/package-lock.json
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: backend/node_modules
+ key: backend-node-modules-${{ hashFiles('backend/package-lock.json') }}
+ - name: 📦 Cache tsbuildinfo
+ uses: actions/cache@v4
+ with:
+ path: backend/node_modules/.tmp/tsconfig.tsbuildinfo
+ key: backend-tsbuildinfo-${{ github.ref }}-${{ github.sha }}
+ restore-keys: |
+ backend-tsbuildinfo-${{ github.ref }}-
+ backend-tsbuildinfo-
- name: Install dependencies
- run: npm install
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
working-directory: backend
- name: Run type check
run: npm run type:check
working-directory: backend
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+
+ steps:
+ - name: ☁️ Checkout source
+ uses: actions/checkout@v4
+ - name: 🔧 Setup Node 22
+ uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: backend/node_modules
+ key: backend-node-modules-${{ hashFiles('backend/package-lock.json') }}
+ - name: Install dependencies
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
+ working-directory: backend
- name: Run lint check
run: npm run lint
working-directory: backend
diff --git a/.github/workflows/check-fe-ts-and-lint.yml b/.github/workflows/check-fe-ts-and-lint.yml
index 12c59dbb04..9587987f2b 100644
--- a/.github/workflows/check-fe-ts-and-lint.yml
+++ b/.github/workflows/check-fe-ts-and-lint.yml
@@ -10,26 +10,62 @@ on:
- "frontend/.eslintrc.js"
jobs:
- check-fe-ts-lint:
- name: Check Frontend Type and Lint check
+ type-check:
+ name: Type Check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: ☁️ Checkout source
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: 🔧 Setup Node 22
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: "22"
- cache: "npm"
- cache-dependency-path: frontend/package-lock.json
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: frontend/node_modules
+ key: frontend-node-modules-${{ hashFiles('frontend/package-lock.json') }}
+ - name: 📦 Cache tsbuildinfo
+ uses: actions/cache@v4
+ with:
+ path: frontend/node_modules/.tmp/tsconfig.app.tsbuildinfo
+ key: frontend-tsbuildinfo-${{ github.ref }}-${{ github.sha }}
+ restore-keys: |
+ frontend-tsbuildinfo-${{ github.ref }}-
+ frontend-tsbuildinfo-
- name: 📦 Install dependencies
- run: npm install
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
working-directory: frontend
- name: 🏗️ Run Type check
run: npm run type:check
working-directory: frontend
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+
+ steps:
+ - name: ☁️ Checkout source
+ uses: actions/checkout@v4
+ - name: 🔧 Setup Node 22
+ uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: frontend/node_modules
+ key: frontend-node-modules-${{ hashFiles('frontend/package-lock.json') }}
+ - name: 📦 Install dependencies
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
+ working-directory: frontend
- name: 🏗️ Run Lint check
run: npm run lint
working-directory: frontend
diff --git a/.github/workflows/run-backend-bdd-tests.yml b/.github/workflows/run-backend-bdd-tests.yml
index 2fd2c844a1..27d2127e62 100644
--- a/.github/workflows/run-backend-bdd-tests.yml
+++ b/.github/workflows/run-backend-bdd-tests.yml
@@ -25,7 +25,7 @@ jobs:
docker system prune -af
- name: ☁️ Checkout source
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install Python
@@ -36,11 +36,9 @@ jobs:
with:
version: "2.14.2"
- name: 🔧 Setup Node 22
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: "22"
- cache: "npm"
- cache-dependency-path: backend/package-lock.json
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
@@ -52,8 +50,15 @@ jobs:
cmake -S /tmp/sscep-build -B /tmp/sscep-build/build
make -C /tmp/sscep-build/build -j$(nproc)
sudo cp /tmp/sscep-build/build/sscep /usr/local/bin/sscep
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: backend/node_modules
+ key: backend-node-modules-${{ hashFiles('backend/package-lock.json') }}
- name: Install dependencies
- run: npm install
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
working-directory: backend
- name: Output .env file and enable feature flags for BDD tests
diff --git a/.github/workflows/run-backend-tests.yml b/.github/workflows/run-backend-tests.yml
index 1e702dec87..ec0cb8e250 100644
--- a/.github/workflows/run-backend-tests.yml
+++ b/.github/workflows/run-backend-tests.yml
@@ -25,20 +25,25 @@ jobs:
docker system prune -af
- name: ☁️ Checkout source
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- uses: KengoTODA/actions-setup-docker-compose@v1
if: ${{ env.ACT }}
name: Install `docker compose` for local simulations
with:
version: "2.14.2"
- name: 🔧 Setup Node 22
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: "22"
- cache: "npm"
- cache-dependency-path: backend/package-lock.json
+ - name: 📦 Cache node_modules
+ id: cache-node-modules
+ uses: actions/cache@v4
+ with:
+ path: backend/node_modules
+ key: backend-node-modules-${{ hashFiles('backend/package-lock.json') }}
- name: Install dependencies
- run: npm install
+ if: steps.cache-node-modules.outputs.cache-hit != 'true'
+ run: npm ci
working-directory: backend
- name: Start postgres and redis
run: touch .env && docker compose -f docker-compose.dev.yml up -d db redis
diff --git a/backend/tsconfig.json b/backend/tsconfig.json
index db076a30d6..fffc1390fa 100644
--- a/backend/tsconfig.json
+++ b/backend/tsconfig.json
@@ -22,6 +22,8 @@
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
+ "incremental": true,
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@app/*": ["./src/*"],
diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json
index f9379c1c1e..3dc42b9198 100644
--- a/frontend/tsconfig.app.json
+++ b/frontend/tsconfig.app.json
@@ -1,5 +1,6 @@
{
"compilerOptions": {
+ "incremental": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,