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 }}
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
|
||||||
PNPM_STORE_DIR: /pnpm-store
|
|
||||||
COREPACK_HOME: /pnpm-store/.corepack
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-and-test:
|
lint-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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:
|
build:
|
||||||
needs: [lint-and-test]
|
needs: [lint-and-test]
|
||||||
@@ -34,9 +37,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
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
|
- name: Detect and build changed apps
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -4,19 +4,21 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
env:
|
|
||||||
PNPM_STORE_DIR: /pnpm-store
|
|
||||||
COREPACK_HOME: /pnpm-store/.corepack
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- name: Determine changed apps
|
||||||
id: changes
|
id: changes
|
||||||
@@ -47,11 +49,9 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Comment preview URL
|
- name: Comment preview URL
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ gitea.token }}
|
|
||||||
run: |
|
run: |
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${{ gitea.token }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"body\": \"## Preview Deploy\nNamespace: \`preview-${{ gitea.event.number }}\`\nArgoCD will sync automatically.\"}" \
|
-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"
|
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.number }}/comments"
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
env:
|
|
||||||
PNPM_STORE_DIR: /pnpm-store
|
|
||||||
COREPACK_HOME: /pnpm-store/.corepack
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -22,9 +18,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
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
|
- name: Determine changed apps
|
||||||
id: changes
|
id: changes
|
||||||
|
|||||||
Reference in New Issue
Block a user