Skip to content

Commit

Permalink
cache macOS CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 11, 2024
1 parent 5064162 commit 4d5775c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,15 @@ jobs:
- name: Install dependencies
run: brew install zlib cmake pkg-config automake coreutils

- run: mkdir runtime output
working-directory: packaging/binaries
- run: mkdir work runtime-output output
working-directory: packaging/binaries/macos

- name: Determine runtime version
id: determine_runtime_version
run: |
RUNTIME_VERSION=$(cat shared/definitions/macos_runtime_version)
RUNTIME_VERSION=$(cat ../shared/definitions/macos_runtime_version)
echo "version=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
working-directory: packaging/binaries

- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
working-directory: packaging/binaries/macos


- name: Fetch RVM cache
Expand All @@ -106,32 +99,40 @@ jobs:
BLOB_NAME: "binaries/rvm-${{ hashFiles('packaging/binaries/shared/definitions/ruby_versions') }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd"


- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}


- name: Fetch runtime cache
run: ./dev/ci/fetch-cache-az-blob-storage
id: fetch_runtime_cache
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: binaries/macos-runtime-${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd
CACHE_PATH: packaging/binaries/runtime
CACHE_PATH: packaging/binaries/macos/runtime-output

- name: Compile runtime
run: ./macos/setup-runtime -o runtime -j 4
run: ./setup-runtime -w work -o runtime-output -j 4
if: steps.fetch_runtime_cache.outputs.cache-hit != 'true'
working-directory: packaging/binaries
working-directory: packaging/binaries/macos

- name: Update runtime cache
run: ./dev/ci/update-cache-az-blob-storage
if: steps.fetch_runtime_cache.outputs.cache-hit != 'true'
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: binaries/macos-runtime-${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd
CACHE_PATH: packaging/binaries/runtime
CACHE_PATH: packaging/binaries/macos/runtime-output


- run: ./macos/build -p "$WORKSPACE" -r runtime -o output -j 4 passenger nginx
- run: ./build -p "$WORKSPACE" -r runtime-output -w work -o output -j 4 passenger nginx
env:
WORKSPACE: ${{ github.workspace }}
working-directory: packaging/binaries
working-directory: packaging/binaries/macos

- uses: actions/upload-artifact@v4
with:
Expand All @@ -140,12 +141,19 @@ jobs:


- run: ./macos/package -i output -o output
working-directory: packaging/binaries
working-directory: packaging/binaries/macos

- run: ./macos/test -p ../.. -r runtime -i output -I output
working-directory: packaging/binaries
- run: ./macos/test -p ../.. -r runtime-output -i output -I output
working-directory: packaging/binaries/macos


- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

- name: Archive configure logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: generic-binaries-logs-macos
path: packaging/binaries/macos/work/*/config.log

0 comments on commit 4d5775c

Please sign in to comment.