chore(CI): use cache for mac

This commit is contained in:
zhanghongtong 2021-05-08 13:59:24 +08:00 committed by turtleDeng
parent a07fece436
commit 29bbc0802b
2 changed files with 18 additions and 4 deletions

View File

@ -137,10 +137,17 @@ jobs:
run: unzip -q source.zip run: unzip -q source.zip
- name: prepare - name: prepare
run: | run: |
brew update
brew install curl zip unzip gnu-sed kerl unixodbc freetds brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store git config --global credential.helper store
- uses: actions/cache@v2
id: cache
with:
path: ~/.kerl
key: erl${{ matrix.erl_otp }}-macos10.15
- name: build erlang - name: build erlang
if: steps.cache.outputs.cache-hit != 'true'
timeout-minutes: 60 timeout-minutes: 60
run: | run: |
kerl build ${{ matrix.erl_otp }} kerl build ${{ matrix.erl_otp }}
@ -153,7 +160,7 @@ jobs:
run: | run: |
cd source cd source
pkg_name=$(basename _packages/${{ matrix.profile }}/${{ matrix.profile }}-*.zip) pkg_name=$(basename _packages/${{ matrix.profile }}/${{ matrix.profile }}-*.zip)
unzip _packages/${{ matrix.profile }}/$pkg_name unzip -q _packages/${{ matrix.profile }}/$pkg_name
gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
./emqx/bin/emqx start || cat emqx/log/erlang.log.1 ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
ready='no' ready='no'

View File

@ -69,10 +69,17 @@ jobs:
fi fi
- name: prepare - name: prepare
run: | run: |
brew update
brew install curl zip unzip gnu-sed kerl unixodbc freetds brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store git config --global credential.helper store
- uses: actions/cache@v2
id: cache
with:
path: ~/.kerl
key: erl${{ matrix.erl_otp }}-macos10.15
- name: build erlang - name: build erlang
if: steps.cache.outputs.cache-hit != 'true'
timeout-minutes: 60 timeout-minutes: 60
run: | run: |
kerl build ${{ matrix.erl_otp }} kerl build ${{ matrix.erl_otp }}
@ -84,7 +91,7 @@ jobs:
- name: test - name: test
run: | run: |
pkg_name=$(basename _packages/${EMQX_NAME}/emqx-*.zip) pkg_name=$(basename _packages/${EMQX_NAME}/emqx-*.zip)
unzip _packages/${EMQX_NAME}/$pkg_name unzip -q _packages/${EMQX_NAME}/$pkg_name
gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
./emqx/bin/emqx start || cat emqx/log/erlang.log.1 ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
ready='no' ready='no'
@ -103,7 +110,7 @@ jobs:
./emqx/bin/emqx_ctl status ./emqx/bin/emqx_ctl status
./emqx/bin/emqx stop ./emqx/bin/emqx stop
rm -rf emqx rm -rf emqx
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v2
with: with:
name: macos name: macos
path: _packages/emqx/. path: _packages/**/*.zip