From e8f94e7d2acd0b361b919f74aa210bc72ad516aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 22 Oct 2020 11:33:11 +0200 Subject: [PATCH] Add action to build changed add-ons (#1635) * Add action to build changed add-ons * Use our new action --- .github/workflows/build.yml | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..74b1be8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,72 @@ +name: Build +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + +jobs: + init: + runs-on: ubuntu-latest + name: Initialize builds + outputs: + changed_files: ${{ steps.changed_files.outputs.all }} + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Get changed files + id: changed_files + uses: jitterbit/get-changed-files@v1 + + build: + needs: init + runs-on: ubuntu-latest + name: Build ${{ matrix.addon }} add-on + outputs: + changed: ${{ steps.changed.outputs.changed }} + strategy: + fail-fast: False + matrix: + addon: + - ada + - almond + - cec_scan + - check_config + - configurator + - deconz + - dhcp_server + - dnsmasq + - duckdns + - git_pull + - google_assistant + - homematic + - letsencrypt + - mariadb + - mosquitto + - nginx_proxy + - rpc_shutdown + - samba + - ssh + - tellstick + - zwave + steps: + - name: Check if ${{ matrix.addon }} was changed + id: changed + run: | + if [[ "${{ needs.init.outputs.changed_files }}" =~ "${{ matrix.addon }}" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Check out repository + if: steps.changed.outputs.changed == 'true' + uses: actions/checkout@v2 + + - name: Test docker build for ${{ matrix.addon }} + if: steps.changed.outputs.changed == 'true' + uses: home-assistant/hassio-builder@master + with: + args: | + --test \ + --all \ + --target /data/${{ matrix.addon }} \ No newline at end of file