Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into lforst-bump-bp
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Aug 29, 2024
2 parents 512757d + 7d331fa commit 7924158
Show file tree
Hide file tree
Showing 128 changed files with 1,903 additions and 650 deletions.
4 changes: 1 addition & 3 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ outputs:
runs:
using: "composite"
steps:
# we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
# so no need to reinstall them
- name: Compute dependency cache key
id: compute_lockfile_hash
run: echo "hash=dependencies-${{ hashFiles('yarn.lock', 'packages/*/package.json', 'dev-packages/*/package.json') }}" >> "$GITHUB_OUTPUT"
run: node ./scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT"
shell: bash

- name: Check dependency cache
Expand Down
18 changes: 9 additions & 9 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ runs:
~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

# Only store cache on develop branch
- name: Store cached playwright binaries
uses: actions/cache/save@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

# We always install all browsers, if uncached
- name: Install Playwright dependencies (uncached)
run: npx playwright install chromium webkit firefox --with-deps
Expand All @@ -40,3 +31,12 @@ runs:
run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
if: steps.playwright-cache.outputs.cache-hit == 'true'
shell: bash

# Only store cache on develop branch
- name: Store cached playwright binaries
uses: actions/cache/save@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
37 changes: 27 additions & 10 deletions .github/actions/restore-cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: "Restore dependency & build cache"
description: "Restore the dependency & build cache."

inputs:
dependency_cache_key:
description: "The dependency cache key"
required: true
node_version:
description: "If set, temporarily set node version to default one before installing, then revert to this version after."
required: false

runs:
using: "composite"
steps:
Expand All @@ -9,17 +17,26 @@ runs:
uses: actions/cache/restore@v4
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ env.DEPENDENCY_CACHE_KEY }}
key: ${{ inputs.dependency_cache_key }}

- name: Check build cache
uses: actions/cache/restore@v4
id: build-cache
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.CACHED_BUILD_PATHS }}
key: ${{ env.BUILD_CACHE_KEY }}
name: build-output

- name: Use default node version for install
if: inputs.node_version && steps.dep-cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

- name: Install dependencies
if: steps.dep-cache.outputs.cache-hit != 'true'
run: yarn install --ignore-engines --frozen-lockfile
shell: bash

- name: Check if caches are restored
uses: actions/github-script@v6
if: steps.dep-cache.outputs.cache-hit != 'true' || steps.build-cache.outputs.cache-hit != 'true'
- name: Revert node version to ${{ inputs.node_version }}
if: inputs.node_version && steps.dep-cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
script: core.setFailed('Dependency or build cache could not be restored - please re-run ALL jobs.')
node-version: ${{ inputs.node_version }}
Loading

0 comments on commit 7924158

Please sign in to comment.