gluon/.github/workflows/build-gluon.yml
Matthias Schiffer d8aca7f211
workflows: build-gluon: avoid failure when no path filter matches
The CI should be successful when there is nothing to check. Add if
condition as proposed in [1].

[1] https://github.com/dorny/paths-filter/issues/66#issuecomment-778267385
2021-12-18 23:51:17 +01:00

56 lines
1.3 KiB
YAML

name: Build Gluon
on:
push:
branches:
- master
- next*
- v20*
pull_request:
types: [opened, synchronize, reopened]
jobs:
changed:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2
# Filter targets based on changed files
- uses: dorny/paths-filter@v2
id: filter
with:
filters: .github/filters.yml
build_firmware:
needs: changed
if: ${{ needs.changed.outputs.targets != '[]' && needs.changed.outputs.targets != '' }}
strategy:
fail-fast: false
matrix:
# Read back changd targets to create build matrix
target: ${{ fromJSON(needs.changed.outputs.targets) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo contrib/actions/install-dependencies.sh
- name: Build
run: contrib/actions/run-build.sh ${{ matrix.target }}
- name: Archive build logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v2.3.1
with:
name: ${{ matrix.target }}_logs
path: openwrt/logs
- name: Archive build output
uses: actions/upload-artifact@v2.3.1
with:
name: ${{ matrix.target }}_output
path: output