Merge pull request #27019 from backstage/rugvip/cache

workflows: use separate cache for the CLI success cache
This commit is contained in:
Patrik Oldsberg
2024-10-08 17:43:43 +02:00
committed by GitHub
2 changed files with 24 additions and 3 deletions
+17 -2
View File
@@ -233,11 +233,18 @@ jobs:
- name: verify release
run: node scripts/verify-release.js
# Use the lower-level cache actions for the success cache, so that we can store the cache even on failed builds
- name: restore backstage-cli cache
uses: actions/cache/restore@v4
with:
path: .cache/backstage-cli
key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli
- name: lint changed packages
run: yarn backstage-cli repo lint --since origin/master --successCache
run: yarn backstage-cli repo lint --since origin/master --successCache --successCacheDir .cache/backstage-cli
- name: test changed packages
run: yarn backstage-cli repo test --maxWorkers=3 --workerIdleMemoryLimit=1300M --since origin/master --successCache
run: yarn backstage-cli repo test --maxWorkers=3 --workerIdleMemoryLimit=1300M --since origin/master --successCache --successCacheDir .cache/backstage-cli
env:
BACKSTAGE_TEST_DISABLE_DOCKER: 1
BACKSTAGE_TEST_DATABASE_POSTGRES16_CONNECTION_STRING: postgresql://postgres:postgres@localhost:${{ job.services.postgres16.ports[5432] }}
@@ -245,6 +252,14 @@ jobs:
BACKSTAGE_TEST_DATABASE_MYSQL8_CONNECTION_STRING: mysql://root:root@localhost:${{ job.services.mysql8.ports[3306] }}/ignored
BACKSTAGE_TEST_CACHE_REDIS7_CONNECTION_STRING: redis://localhost:${{ job.services.redis.ports[6379] }}
# Always save success cache even if there were failures, that way it can be used in re-triggered builds
- name: save backstage-cli cache
uses: actions/cache/save@v4
if: always()
with:
path: .cache/backstage-cli
key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli
# We run the test cases before verifying the specs to prevent any failing tests from causing errors.
- name: verify openapi specs against test cases
run: yarn backstage-repo-tools repo schema openapi test
+7 -1
View File
@@ -93,8 +93,14 @@ jobs:
- name: validate config
run: yarn backstage-cli config:check --lax
- name: backstage-cli cache
uses: actions/cache@v4
with:
path: .cache/backstage-cli
key: ${{ runner.os }}-v${{ matrix.node-version }}-backstage-cli
- name: lint
run: yarn backstage-cli repo lint --successCache
run: yarn backstage-cli repo lint --successCache --successCacheDir .cache/backstage-cli
- name: type checking and declarations
run: yarn tsc:full