Skip to content

Commit

Permalink
Update CI/CD workflow to configure pnpm store directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Quiirex committed Jun 14, 2024
1 parent 21ddf86 commit 1782ac4
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:
uses: actions/checkout@v4

- name: Cache pnpm store
id: cache-pnpm
id: pnpm-cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-
- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Install dependencies
Expand All @@ -45,16 +45,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Install dependencies
Expand All @@ -80,16 +80,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Install dependencies
Expand Down Expand Up @@ -118,26 +118,26 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Install dependencies
run: pnpm install

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Install OWASP ZAP
uses: zaproxy/action-full-scan@v0.5.0
with:
Expand All @@ -151,16 +151,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Generate Cypress testing report
Expand All @@ -180,6 +180,7 @@ jobs:

- name: Generate consolidated report
run: |
# Assuming you have a script or tool to merge different test reports
pnpm run generate-consolidated-report
- name: Upload consolidated report
Expand All @@ -196,20 +197,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Upload test results to Test Management Tool
run: |
# Replace with actual commands to upload to your test management tool
curl -X POST -H "Content-Type: application/json" -d @path/to/consolidated-report.json http://test-management-tool/api/upload
deployment:
Expand All @@ -220,16 +222,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Restore pnpm store
- name: Restore pnpm store cache
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ needs.static-code-analysis.outputs.cache-pnpm }}
key: ${{ needs.static-code-analysis.outputs['pnpm-cache'] }}

- name: Install pnpm
run: npm install -g pnpm

- name: Configure pnpm to use store
- name: Configure pnpm store
run: pnpm config set store-dir ~/.pnpm-store

- name: Deploy to production
Expand Down

0 comments on commit 1782ac4

Please sign in to comment.