Fix pnpm cache: use inline export instead of workflow env block
act_runner v0.3.0 doesn't propagate workflow-level or job-level env: blocks to job containers. Use export in run commands instead. First run warms cache, subsequent runs will show reused packages.
This commit is contained in:
@@ -10,21 +10,24 @@ concurrency:
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PNPM_STORE_DIR: /pnpm-store
|
||||
COREPACK_HOME: /pnpm-store/.corepack
|
||||
|
||||
jobs:
|
||||
lint-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: corepack enable && corepack prepare pnpm@latest --activate
|
||||
- name: Setup pnpm
|
||||
run: |
|
||||
export COREPACK_HOME=/pnpm-store/.corepack
|
||||
corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
export PNPM_STORE_DIR=/pnpm-store
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- run: pnpm turbo lint test
|
||||
- name: Lint and test
|
||||
run: pnpm turbo lint test
|
||||
|
||||
build:
|
||||
needs: [lint-and-test]
|
||||
@@ -34,9 +37,15 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: corepack enable && corepack prepare pnpm@latest --activate
|
||||
- name: Setup pnpm
|
||||
run: |
|
||||
export COREPACK_HOME=/pnpm-store/.corepack
|
||||
corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
export PNPM_STORE_DIR=/pnpm-store
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Detect and build changed apps
|
||||
run: |
|
||||
|
||||
@@ -4,19 +4,21 @@ on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
env:
|
||||
PNPM_STORE_DIR: /pnpm-store
|
||||
COREPACK_HOME: /pnpm-store/.corepack
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: corepack enable && corepack prepare pnpm@latest --activate
|
||||
- name: Setup pnpm
|
||||
run: |
|
||||
export COREPACK_HOME=/pnpm-store/.corepack
|
||||
corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
export PNPM_STORE_DIR=/pnpm-store
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Determine changed apps
|
||||
id: changes
|
||||
@@ -47,11 +49,9 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Comment preview URL
|
||||
env:
|
||||
GITEA_TOKEN: ${{ gitea.token }}
|
||||
run: |
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Authorization: token ${{ gitea.token }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\": \"## Preview Deploy\nNamespace: \`preview-${{ gitea.event.number }}\`\nArgoCD will sync automatically.\"}" \
|
||||
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.number }}/comments"
|
||||
|
||||
@@ -10,10 +10,6 @@ on:
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
env:
|
||||
PNPM_STORE_DIR: /pnpm-store
|
||||
COREPACK_HOME: /pnpm-store/.corepack
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -22,9 +18,15 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- run: corepack enable && corepack prepare pnpm@latest --activate
|
||||
- name: Setup pnpm
|
||||
run: |
|
||||
export COREPACK_HOME=/pnpm-store/.corepack
|
||||
corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
export PNPM_STORE_DIR=/pnpm-store
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Determine changed apps
|
||||
id: changes
|
||||
|
||||
Reference in New Issue
Block a user