Skip to content

Commit

Permalink
ci: Use forked docker-cache with fix for Bash path
Browse files Browse the repository at this point in the history
  The `ScribeMD/docke-cache` Github action we use to cache the
  `cozy-app-dev` docker image does not properly run on Github Actions'
  macOS images as it expects Bash to be available at `/usr/bin/bash` but
  Bash is not available by default and Homebrew installs it in a
  different path as `/usr/bin` is read-only.

  To make this action work for us, we forked it to add a `bash` input
  that accepts a string specifying the Bash path to use.
  We'll use our fork until we can get the upstream project to be fixed.
  • Loading branch information
taratatach committed Jul 23, 2024
1 parent d3f63f6 commit b5d90ae
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ jobs:
brew install bash
echo "bash-path=$(brew --prefix)/bin/bash" >> $GITHUB_OUTPUT
- name: Cache Docker images.
uses: ScribeMD/docker-cache@0.5.0
uses: cozy-labs/docker-cache@0.7.0
with:
key: ${{ needs.docker_cache_key.outputs.key }}
bash: ${{ steps.install-bash.outputs.bash-path }}
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -148,10 +149,16 @@ jobs:
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup Docker
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Install Bash for docker-cache
id: install-bash
run: |
brew install bash
echo "bash-path=$(brew --prefix)/bin/bash" >> $GITHUB_OUTPUT
- name: Cache Docker images.
uses: ScribeMD/docker-cache@0.5.0
uses: cozy-labs/docker-cache@0.7.0
with:
key: ${{ needs.docker_cache_key.outputs.key }}
bash: ${{ steps.install-bash.outputs.bash-path }}
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -212,10 +219,16 @@ jobs:
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup Docker
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Install Bash for docker-cache
id: install-bash
run: |
brew install bash
echo "bash-path=$(brew --prefix)/bin/bash" >> $GITHUB_OUTPUT
- name: Cache Docker images.
uses: ScribeMD/docker-cache@0.5.0
uses: cozy-labs/docker-cache@0.7.0
with:
key: ${{ needs.docker_cache_key.outputs.key }}
bash: ${{ steps.install-bash.outputs.bash-path }}
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit b5d90ae

Please sign in to comment.