From deaea12aca873febc43e9f6d82eac1356585ae04 Mon Sep 17 00:00:00 2001 From: William Yang Date: Thu, 13 Jan 2022 11:41:45 +0100 Subject: [PATCH] ci(mac): cache otp install only only cache otp installation instead of the entire kerl dir to save cache spaces --- .github/workflows/build_packages.yaml | 4 ++-- .github/workflows/build_slim_packages.yaml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index 78e48f3df..8575a5391 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -164,8 +164,8 @@ jobs: - uses: actions/cache@v2 id: cache with: - path: ~/.kerl - key: erl${{ matrix.otp }}-${{ matrix.macos }} + path: ~/.kerl/${{ matrix.otp }} + key: otp-install-${{ matrix.otp }}-${{ matrix.macos }} - name: build erlang if: steps.cache.outputs.cache-hit != 'true' timeout-minutes: 60 diff --git a/.github/workflows/build_slim_packages.yaml b/.github/workflows/build_slim_packages.yaml index e9b62a166..df02bc625 100644 --- a/.github/workflows/build_slim_packages.yaml +++ b/.github/workflows/build_slim_packages.yaml @@ -67,7 +67,7 @@ jobs: strategy: fail-fast: false matrix: - erl_otp: + otp: - 24.1.5-3 macos: - macos-11 @@ -96,8 +96,8 @@ jobs: - uses: actions/cache@v2 id: cache with: - path: ~/.kerl - key: otp-${{ matrix.erl_otp }}-${{ matrix.macos }} + path: ~/.kerl/${{ matrix.otp }} + key: otp-install-${{ matrix.otp }}-${{ matrix.macos }} - name: build erlang if: steps.cache.outputs.cache-hit != 'true' timeout-minutes: 60 @@ -106,11 +106,11 @@ jobs: OTP_GITHUB_URL: https://github.com/emqx/otp run: | kerl update releases - kerl build ${{ matrix.erl_otp }} - kerl install ${{ matrix.erl_otp }} $HOME/.kerl/${{ matrix.erl_otp }} + kerl build ${{ matrix.otp }} + kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }} - name: build run: | - . $HOME/.kerl/${{ matrix.erl_otp }}/activate + . $HOME/.kerl/${{ matrix.otp }}/activate make ensure-rebar3 sudo cp rebar3 /usr/local/bin/rebar3 make ${EMQX_NAME}-zip