diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ebb85dd..d7e3acf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,32 +28,6 @@ jobs: run: | echo ::set-output name=CHANGELOG::$(cat CHANGELOG.md) - # build: - # runs-on: ubuntu-latest - # name: Build & Publish ${{ matrix.arch }} - # needs: - # - metadata - # strategy: - # matrix: - # arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] - - # steps: - # - name: Check out repository - # uses: actions/checkout@v3 - - # - name: Login to DockerHub - # uses: docker/login-action@v2.0.0 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # - name: Build & Push to Dockerhub - ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }} - # uses: home-assistant/builder@2022.03.1 - # with: - # args: | - # --${{ matrix.arch }} \ - # --target . - publish: runs-on: ubuntu-latest needs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69f05de..3318043 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,44 +1,13 @@ name: Test env: MONITORED_FILES: "apparmor.txt build.yaml config.yaml Dockerfile data rootfs" -on: +on: workflow_dispatch: push: branch: [main] pull_request: branches: [main] jobs: - build: - runs-on: ubuntu-latest - name: Build Test for ${{ matrix.arch }} - strategy: - matrix: - arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] - - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - all_but_latest: true - access_token: ${{ github.token }} - - - name: Check out repository - uses: actions/checkout@v3 - - - name: Login to DockerHub - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: ${{ matrix.arch }} - uses: home-assistant/builder@2022.03.1 - with: - args: | - --test \ - --${{ matrix.arch }} \ - --target . python: name: "Python Tests" runs-on: ubuntu-latest @@ -63,7 +32,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - action: + action: - "test:ci" - "tsc:ci" - "build" @@ -72,12 +41,50 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: 'yarn' + cache: "yarn" cache-dependency-path: webapp/yarn.lock - name: Install Dependencies run: cd webapp && yarn install - name: Run Tests run: cd webapp && yarn ${{ matrix.action }} - - \ No newline at end of file + metadata: + runs-on: ubuntu-latest + name: Metadata + outputs: + version: ${{ steps.get_version.outputs.VERSION }} + steps: + - name: Get the version + id: version + shell: "bash" + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)-g$(echo ${{ github.sha }} | cut -c1-3) + + deploy: + runs-on: ubuntu-latest + name: Build & Publish ${{ matrix.arch }} + needs: + - metadata + - nodejs + - python + strategy: + matrix: + arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Login to DockerHub + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build & Push to Dockerhub - ${{ matrix.arch }} / ${{ needs.metadata.outputs.version }} + uses: home-assistant/builder@2022.03.1 + with: + args: | + --${{ matrix.arch }} \ + --version ${{ needs.metadata.outputs.version }} \ + --additional-tag edge \ + --target . diff --git a/.vscode/settings.json b/.vscode/settings.json index 703af2a..0d69f8f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,8 @@ "*test_*.py" ], "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true + "python.testing.unittestEnabled": true, + "yaml.schemas": { + "https://json.schemastore.org/github-action.json": ".github/workflows/*.yml" + } } \ No newline at end of file