ci: in 'prepare' step, make clean-all before fetch deps

This commit is contained in:
Zaiming (Stone) Shi 2023-05-05 20:46:53 +02:00
parent 7b7fb6c09e
commit ccb289974a
2 changed files with 20 additions and 10 deletions

View File

@ -77,7 +77,12 @@ jobs:
echo "VERSION=$(./pkg-vsn.sh $PROFILE)" >> $GITHUB_OUTPUT
- name: get_all_deps
run: |
make -C source deps-all
pushd source
# make sure all previous left-overs are cleaned
make clean-all
# enterprise is a super-set, should be enough for all profiles
make deps-emqx-enterprise
popd
zip -ryq source.zip source/* source/.[^.]*
- uses: actions/upload-artifact@v3
with:
@ -175,6 +180,8 @@ jobs:
linux:
needs: prepare
runs-on: ${{ matrix.build_machine }}
# always run in builder container because the host might have the wrong OTP version etc.
# otherwise buildx.sh does not run docker if arch and os matches the target arch and os.
container:
image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
@ -249,12 +256,9 @@ jobs:
- name: build emqx packages
working-directory: source
env:
BUILDER: ${{ matrix.builder }}
ELIXIR: ${{ matrix.elixir }}
OTP: ${{ matrix.otp }}
PROFILE: ${{ matrix.profile }}
ARCH: ${{ matrix.arch }}
SYSTEM: ${{ matrix.os }}
run: |
set -eu
git config --global --add safe.directory "/__w/emqx/emqx"
@ -278,7 +282,7 @@ jobs:
--pkgtype "${PKGTYPE}" \
--arch "${ARCH}" \
--elixir "${IS_ELIXIR}" \
--builder "ghcr.io/emqx/emqx-builder/${BUILDER}:${ELIXIR}-${OTP}-${SYSTEM}"
--builder "builder_to_be_ignored"
done
- uses: actions/upload-artifact@v3
if: success()

View File

@ -28,7 +28,12 @@ jobs:
fetch-depth: 0
- name: get_all_deps
run: |
make -C source deps-all
pushd source
# make sure all previous left-overs are cleaned
make clean-all
# enterprise is a super-set, should be enough for all profiles
make deps-emqx-enterprise
popd
zip -ryq source.zip source/* source/.[^.]*
- uses: actions/upload-artifact@v3
with:
@ -38,6 +43,10 @@ jobs:
linux:
needs: prepare
runs-on: aws-${{ matrix.arch }}
# always run in builder container because the host might have the wrong OTP version etc.
# otherwise buildx.sh does not run docker if arch and os matches the target arch and os.
container:
image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
strategy:
fail-fast: false
@ -72,12 +81,9 @@ jobs:
- name: build emqx packages
working-directory: source
env:
BUILDER: ${{ matrix.builder }}
ELIXIR: ${{ matrix.elixir }}
OTP: ${{ matrix.otp }}
PROFILE: ${{ matrix.profile[0] }}
ARCH: ${{ matrix.arch }}
OS: ${{ matrix.os }}
run: |
set -eu
PKGTYPES="tgz pkg"
@ -89,7 +95,7 @@ jobs:
--pkgtype "${PKGTYPE}" \
--arch "${ARCH}" \
--elixir "${IS_ELIXIR}" \
--builder "ghcr.io/emqx/emqx-builder/${BUILDER}:${ELIXIR}-${OTP}-${OS}
--builder "builder_to_be_ignored"
done
- uses: actions/upload-artifact@v3
if: success()