From 793a09e859f2e39eb93f344ccba6b29a11c05072 Mon Sep 17 00:00:00 2001 From: Marc Sune Date: Tue, 1 Oct 2024 03:03:46 +0200 Subject: [PATCH] ci: fix publish-dockerhub (DAEMONS) Commit 82b9ba16, part of #816, broke upload of all DAEMONS but base. The reason why it wasn't detected is because composite action leaves DAEMONS set, so step 3 passes. Fix it by defining it globally, and add a check for the list of DAEMONS. --- .github/actions/build_containers/action.yaml | 1 - .github/workflows/ci.yaml | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/actions/build_containers/action.yaml b/.github/actions/build_containers/action.yaml index ffa8dfbc7..3ad08fb37 100644 --- a/.github/actions/build_containers/action.yaml +++ b/.github/actions/build_containers/action.yaml @@ -9,7 +9,6 @@ inputs: daemons: required: true type: string - default: "pmacctd nfacctd sfacctd uacctd pmbgpd pmbmpd pmtelemetryd" ci_num_workers: required: false type: string diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e39e4804..b82200988 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,6 +7,9 @@ on: - cron: '0 0 * * *' # every day at midnight #Global vars +env: + DAEMONS: "pmacctd nfacctd sfacctd uacctd pmbgpd pmbmpd pmtelemetryd" + jobs: ### Step 1: build container images builder-docker: @@ -21,6 +24,15 @@ jobs: with: path: pmacct + - name: Check DAEMONS env. variable... + run: | + #Sanity, avoid regression #817 + N_DAEMONS="$(echo $DAEMONS | wc --words)" + if [[ "${N_DAEMONS}" != "6" ]]; then + echo "ERROR: invalid number of DAEMONS: ${N_DAEMONS}" + exit 1 + fi + - name: Build docker image for ${{ matrix.builder-name }} run: | cd pmacct @@ -116,6 +128,8 @@ jobs: - name: Build containers uses: ./pmacct/.github/actions/build_containers/ + with: + daemons: ${DAEMONS} - name: Docker save images run: |