diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d6c5bf8..bee211d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,7 +19,7 @@ jobs: - name: Set-up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 20 cache: 'pnpm' - name: Install deps run: pnpm install diff --git a/.github/workflows/ha-beta-tests.yaml b/.github/workflows/ha-beta-tests.yaml index 4ba574a..2f9cb44 100644 --- a/.github/workflows/ha-beta-tests.yaml +++ b/.github/workflows/ha-beta-tests.yaml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 20 cache: 'pnpm' - name: Install run: pnpm install diff --git a/.github/workflows/pull-request-received.yaml b/.github/workflows/pull-request-received.yaml new file mode 100644 index 0000000..236a4fb --- /dev/null +++ b/.github/workflows/pull-request-received.yaml @@ -0,0 +1,29 @@ +name: PR Created + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + run_install: false + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + - name: Install + run: pnpm install + - uses: actions/upload-artifact@v4 + with: + name: pr-bundle + include-hidden-files: true + path: .hass/ + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/test-pr.yaml b/.github/workflows/test-pr.yaml new file mode 100644 index 0000000..c26fae3 --- /dev/null +++ b/.github/workflows/test-pr.yaml @@ -0,0 +1,82 @@ +name: Test PR + +on: + workflow_run: + workflows: + - PR Created + types: + - completed + +jobs: + test-pr: + runs-on: ubuntu-22.04 + if: github.event.workflow_run.conclusion == 'success' + steps: + - name: Set initial status for tests + id: test_check + uses: LouisBrunner/checks-action@v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: test + sha: ${{ github.event.workflow_run.head_sha }} + status: in_progress + - name: Set initial status for coverage + uses: LouisBrunner/checks-action@v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: coverage/coveralls + sha: ${{ github.event.workflow_run.head_sha }} + status: in_progress + - name: Checkout + uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + run_install: false + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + - name: Install + run: pnpm install --ignore-scripts + - name: Download bundle from artifact + uses: actions/download-artifact@v4 + with: + name: pr-bundle + run-id: ${{ github.event.workflow_run.id }} + path: ${{ github.workspace }} + github-token: ${{ github.token }} + - name: E2E tests + id: tests + run: | + touch .env + echo HA_TOKEN=${{ secrets.HA_TOKEN }} >> .env + pnpm test:all + - name: Create coverage + run: pnpm coverage:report + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + git-branch: ${{ github.event.workflow_run.head_branch }} + git-commit: ${{ github.event.workflow_run.head_commit.id }} + #debug: true + - uses: actions/upload-artifact@v3 + if: always() + with: + name: test-report + path: | + playwright-report/ + coverage/ + retention-days: 30 + - name: Set final status for tests + uses: LouisBrunner/checks-action@v2.0.0 + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} + check_id: ${{ steps.test_check.outputs.check_id }} + sha: ${{ github.event.workflow_run.head_sha }} + status: completed + conclusion: ${{ job.status }} \ No newline at end of file diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 49d4865..21a6934 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,7 +20,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 20 cache: 'pnpm' - name: Install run: pnpm install diff --git a/README.md b/README.md index 52c0b94..fac6730 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Custom [HACS] plugin that allows you to personalise the [Home Assistant]'s sideb -This is a refactor of [custom-sidebar-v2] by @galloween, which unfortunatelly is now unmaintained and archived. In its beginning, @galloween's code was a refactor of the [original Custom Sidebar] plugin by @Villhellm (R.I.P.). This version refactored completely @galloween's code allowing to use a configuration in `YAML` (as @Villhellm's one) or in `JSON` (as @galloween's version), fixing several bugs, improving performance, and using [home-assistant-query-selector] to make it less likely to break with future Home Assistant front-end updates. +This is a refactor of [custom-sidebar-v2] by @galloween, which unfortunately is now unmaintained and archived. In its beginning, @galloween's code was a refactor of the [original Custom Sidebar] plugin by @Villhellm (R.I.P.). This version refactored completely @galloween's code allowing to use a configuration in `YAML` (as @Villhellm's one) or in `JSON` (as @galloween's version), fixing several bugs, improving performance, and using [home-assistant-query-selector] to make it less likely to break with future Home Assistant front-end updates. ## Installation