From 16e5173bbc8b461d5775769f53035f5b6c808a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sun, 25 Oct 2020 13:08:35 +0100 Subject: [PATCH] Build before test (#60) * Build before test * Use matrix --- .github/workflows/publish.yml | 21 ++++++++++++++++----- .github/workflows/test.yml | 34 +++++++++++++++++++++++++++------- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 13be10c..1b12097 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,16 +11,27 @@ env: GIT_TAG_NAME: dev jobs: + init: + name: Initialize build + runs-on: ubuntu-latest + outputs: + architectures: ${{ steps.info.outputs.architectures }} + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + + - name: Get information + id: info + uses: home-assistant/actions/helpers/info@master + publish: - name: Publish + name: Publish builder + needs: init runs-on: ubuntu-latest strategy: fail-fast: False matrix: - architecture: - - aarch64 - - amd64 - - armv7 + architecture: ${{ fromJson(needs.init.outputs.architectures) }} steps: - name: Checkout the repository uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f9e24d..05352c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,25 +4,45 @@ on: pull_request: jobs: + init: + name: Initialize build + runs-on: ubuntu-latest + outputs: + architectures: ${{ steps.info.outputs.architectures }} + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + + - name: Get information + id: info + uses: home-assistant/actions/helpers/info@master + build: name: Test action build + needs: init runs-on: ubuntu-latest strategy: fail-fast: False matrix: - architecture: - - aarch64 - - amd64 - - armv7 + architecture: ${{ fromJson(needs.init.outputs.architectures) }} steps: - name: Checkout the repository uses: actions/checkout@v2 - - name: Test builder - uses: ./ # This is self-refrencing + - name: Build the builder + uses: home-assistant/builder@master + with: + args: | + --test \ + --amd64 \ + --target /data \ + --generic latest + + - name: Test ${{ matrix.architecture }} builder + uses: ./ with: args: | --test \ --${{ matrix.architecture }} \ --target /data \ - --generic ${{ github.sha }} \ No newline at end of file + --generic ${{ github.sha }}