From 441fbf12836d32fdf08a5a8bc31db890335cf661 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 1 Jan 2021 23:21:52 +0100 Subject: [PATCH] actions: update generation script to use matrix --- contrib/actions/generate-actions.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/contrib/actions/generate-actions.py b/contrib/actions/generate-actions.py index d0a82dfd..78d5b2a5 100755 --- a/contrib/actions/generate-actions.py +++ b/contrib/actions/generate-actions.py @@ -16,34 +16,36 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: -""" - -ACTIONS_TARGET=""" - {target_name}: - name: {target_name} + build_firmware: + strategy: + fail-fast: false + matrix: + target: [{matrix}] runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Install Dependencies run: sudo contrib/actions/install-dependencies.sh - name: Build - run: contrib/actions/run-build.sh {target_name} + run: contrib/actions/run-build.sh ${{{{ matrix.target }}}} - name: Archive build logs if: ${{{{ !cancelled() }}}} uses: actions/upload-artifact@v1 with: - name: {target_name}_logs + name: ${{{{ matrix.target }}}}_logs path: openwrt/logs - name: Archive build output uses: actions/upload-artifact@v1 with: - name: {target_name}_output + name: ${{{{ matrix.target }}}}_output path: output """ -output = ACTIONS_HEAD +targets = [] for target in sys.stdin: - output += ACTIONS_TARGET.format(target_name=target.strip()) + targets.append(target.strip()) + +output = ACTIONS_HEAD.format(matrix=", ".join(targets)) print(output)