mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 15:56:56 +00:00
fix: correct certificate caching keys and fix environment file paths in CI workflows
This commit is contained in:
+11
-23
@@ -10,8 +10,6 @@ jobs:
|
|||||||
setup-environment:
|
setup-environment:
|
||||||
name: Generate Certificates
|
name: Generate Certificates
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
cache-key: ${{ steps.cert-key.outputs.key }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Generate SSL Certificates
|
- name: Generate SSL Certificates
|
||||||
@@ -20,18 +18,12 @@ jobs:
|
|||||||
mkdir -p certs
|
mkdir -p certs
|
||||||
mkcert -install
|
mkcert -install
|
||||||
mkcert -cert-file certs/localhost.pem -key-file certs/localhost-key.pem localhost 127.0.0.1 ::1
|
mkcert -cert-file certs/localhost.pem -key-file certs/localhost-key.pem localhost 127.0.0.1 ::1
|
||||||
echo "cert_path=certs/localhost.pem" >> $GITHUB_OUTPUT
|
|
||||||
echo "key_path=certs/localhost-key.pem" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- id: cert-key
|
|
||||||
run: echo "key=${{ runner.os }}-certs-${{ github.sha }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Cache certificates
|
- name: Cache certificates
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: certs
|
path: certs
|
||||||
key: ${{ runner.os }}-certs-${{ github.sha }}
|
key: certs-${{ runner.os }}-${{ github.sha }}
|
||||||
|
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
name: Frontend CI
|
name: Frontend CI
|
||||||
@@ -43,21 +35,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
|
|
||||||
- name: Restore certificates
|
- name: Restore certificates
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: certs
|
path: certs
|
||||||
key: certs-${{ github.sha }}
|
key: certs-${{ runner.os }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
- name: Code Quality
|
- name: Code Quality
|
||||||
run: |
|
run: |
|
||||||
cp ../.env.example ../.env
|
cp ../.env.example ./ .env
|
||||||
bun run check
|
bun run check
|
||||||
|
|
||||||
- name: Type Check & Build
|
- name: Type Check & Build
|
||||||
@@ -70,9 +60,6 @@ jobs:
|
|||||||
name: Backend CI
|
name: Backend CI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: setup-environment
|
needs: setup-environment
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: ./backend
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -83,23 +70,26 @@ jobs:
|
|||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./backend
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: backend/uv.lock
|
cache-dependency-glob: "backend/uv.lock"
|
||||||
|
|
||||||
- name: Restore certificates
|
- name: Restore certificates
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: certs
|
path: certs
|
||||||
key: ${{ runner.os }}-certs-${{ github.sha }}
|
key: certs-${{ runner.os }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Setup Environment
|
- name: Setup Environment
|
||||||
run: |
|
run: |
|
||||||
cp ../.env.example ../.env
|
cp ../.env.example .env
|
||||||
uv sync
|
uv sync
|
||||||
|
|
||||||
- name: Lint & Test
|
- name: Lint & Test
|
||||||
@@ -110,7 +100,7 @@ jobs:
|
|||||||
e2e:
|
e2e:
|
||||||
name: E2E Tests
|
name: E2E Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend, backend, setup-environment]
|
needs: setup-environment
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -133,14 +123,12 @@ jobs:
|
|||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
path: certs
|
path: certs
|
||||||
key: certs-${{ github.sha }}
|
key: certs-${{ runner.os }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Setup Tools
|
- name: Setup Tools
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user