Skip to content
Snippets Groups Projects
Commit 441fbf12 authored by David Bauer's avatar David Bauer
Browse files

actions: update generation script to use matrix

parent 7709de67
No related branches found
No related tags found
No related merge requests found
...@@ -16,34 +16,36 @@ on: ...@@ -16,34 +16,36 @@ on:
pull_request: pull_request:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
jobs: jobs:
""" build_firmware:
strategy:
ACTIONS_TARGET=""" fail-fast: false
{target_name}: matrix:
name: {target_name} target: [{matrix}]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Install Dependencies - name: Install Dependencies
run: sudo contrib/actions/install-dependencies.sh run: sudo contrib/actions/install-dependencies.sh
- name: Build - name: Build
run: contrib/actions/run-build.sh {target_name} run: contrib/actions/run-build.sh ${{{{ matrix.target }}}}
- name: Archive build logs - name: Archive build logs
if: ${{{{ !cancelled() }}}} if: ${{{{ !cancelled() }}}}
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: {target_name}_logs name: ${{{{ matrix.target }}}}_logs
path: openwrt/logs path: openwrt/logs
- name: Archive build output - name: Archive build output
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: {target_name}_output name: ${{{{ matrix.target }}}}_output
path: output path: output
""" """
output = ACTIONS_HEAD targets = []
for target in sys.stdin: 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) print(output)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment