Skip to content

Commit 231f88d

Browse files
committed
ci: optimize workflow caching and add concurrency controls
1 parent 594b176 commit 231f88d

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ runs:
3434
if [ ${{ inputs.installDependencies }} = true ]; then
3535
echo "cache=pnpm" >> $GITHUB_OUTPUT
3636
else
37-
echo "cache=" >> "$GITHUB_ENV"
37+
echo "cache=" >> $GITHUB_OUTPUT
3838
fi
3939
4040
- name: install pnpm

.github/workflows/build-and-dockerize.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ jobs:
169169
source: .
170170
set: |
171171
*.cache-from=type=gha,ignore-error=true,scope=${{ steps.docker_cache_key.outputs.replaced }}
172+
*.cache-from=type=gha,ignore-error=true,scope=refs_heads_main-${{ inputs.targets }}-${{ matrix.platform == 'linux/amd64' && 'linux_amd64' || 'linux_arm64' }}
172173
*.cache-to=type=gha,mode=max,ignore-error=true,scope=${{ steps.docker_cache_key.outputs.replaced }}
173174
174175
- name: docker details pr comment

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
node_modules/.cache/prettier
2828
key:
2929
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
30-
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-${{github.sha}}
30+
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}
3131
restore-keys: |
3232
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
3333
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-

.github/workflows/main.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
branches:
55
- main
66

7+
concurrency:
8+
group: ci-main
9+
cancel-in-progress: false
10+
711
jobs:
812
# Release NPM packages and tarballs
913
package:

.github/workflows/pr.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: pr
22
on:
33
pull_request: {}
44

5+
concurrency:
6+
group: pr-${{ github.event.pull_request.number }}
7+
cancel-in-progress: true
8+
59
env:
610
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
711

.github/workflows/prettier.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
path: |
3333
.eslintcache
3434
node_modules/.cache/prettier
35-
key: lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
35+
key: lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
3636
restore-keys: |
3737
lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
3838

0 commit comments

Comments
 (0)