ci: optimize workflow caching and add concurrency controls (#7331)

This commit is contained in:
Adam Benhassen 2025-12-17 11:12:20 +02:00 committed by GitHub
parent 711f4e6a25
commit f0533450be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 3 deletions

View file

@ -34,7 +34,7 @@ runs:
if [ ${{ inputs.installDependencies }} = true ]; then
echo "cache=pnpm" >> $GITHUB_OUTPUT
else
echo "cache=" >> "$GITHUB_ENV"
echo "cache=" >> $GITHUB_OUTPUT
fi
- name: install pnpm

View file

@ -169,6 +169,7 @@ jobs:
source: .
set: |
*.cache-from=type=gha,ignore-error=true,scope=${{ steps.docker_cache_key.outputs.replaced }}
*.cache-from=type=gha,ignore-error=true,scope=refs_heads_main-${{ inputs.targets }}-${{ matrix.platform == 'linux/amd64' && 'linux_amd64' || 'linux_arm64' }}
*.cache-to=type=gha,mode=max,ignore-error=true,scope=${{ steps.docker_cache_key.outputs.replaced }}
- name: docker details pr comment

View file

@ -27,7 +27,7 @@ jobs:
node_modules/.cache/prettier
key:
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-${{github.sha}}
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}
restore-keys: |
lint-cache-${{ hashFiles('**/pnpm-lock.yaml', 'packages/web/*/tailwind.config.ts',
'tsconfig.eslint.json', 'packages/web/app/tsconfig.json') }}-

View file

@ -4,6 +4,10 @@ on:
branches:
- main
concurrency:
group: ci-main
cancel-in-progress: false
jobs:
# Release NPM packages and tarballs
package:

View file

@ -2,6 +2,10 @@ name: pr
on:
pull_request: {}
concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}

View file

@ -32,7 +32,7 @@ jobs:
path: |
.eslintcache
node_modules/.cache/prettier
key: lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
key: lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-