Adds build steps

This commit is contained in:
ludeeus
2019-10-10 15:27:32 +00:00
parent 17e53209e4
commit 07c36d88a1
5 changed files with 27 additions and 11 deletions

View File

@ -36,6 +36,11 @@ jobs:
cp /tmp/lokalise/locale/* custom_components/hacs/.translations/ cp /tmp/lokalise/locale/* custom_components/hacs/.translations/
# Build Frontend
- name: Build the HACS frontend
run: npm run build
# Pack the HACS dir as a zip and upload to the release # Pack the HACS dir as a zip and upload to the release
- name: ZIP HACS Dir - name: ZIP HACS Dir
run: "zip hacs.zip -r custom_components/hacs" run: "zip hacs.zip -r custom_components/hacs"

View File

@ -1,4 +1,4 @@
name: Test with Home Assistant name: Test
on: on:
pull_request: pull_request:
@ -9,8 +9,8 @@ on:
- master - master
jobs: jobs:
test: test_with_home_assistant:
name: Testing with (Python, HA) name: Test with Home Assistant (Python, HA)
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
max-parallel: 6 max-parallel: 6
@ -66,3 +66,12 @@ jobs:
cat configuration.yaml cat configuration.yaml
echo "" echo ""
hass --script check_config --config . hass --script check_config --config .
test_frontend_build:
name: Test frontend build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build the HACS frontend
run: npm run build

View File

@ -1,6 +1,8 @@
/* eslint-disable no-console, no-undef, prefer-destructuring, prefer-destructuring, no-constant-condition, max-len */ /* eslint-disable no-console, no-undef, prefer-destructuring, prefer-destructuring, no-constant-condition, max-len */
import { HomeAssistant } from "custom-card-helpers"; import { HomeAssistant } from "custom-card-helpers";
import { css, CSSResultArray, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import {
css, CSSResultArray, customElement, html, LitElement, property, TemplateResult
} from "lit-element";
import { load_lovelace } from "./misc/LoadLovelace"; import { load_lovelace } from "./misc/LoadLovelace";
import { navigate } from "./misc/navigate"; import { navigate } from "./misc/navigate";
import scrollToTarget from "./misc/ScrollToTarget"; import scrollToTarget from "./misc/ScrollToTarget";
@ -79,11 +81,12 @@ class HacsFrontendBase extends LitElement {
// Event subscription // Event subscription
this.hass.connection.sendMessagePromise( this.hass.connection.sendMessagePromise(
{ type: "hacs/repository" }); { type: "hacs/repository" }
);
this.hass.connection.subscribeEvents( this.hass.connection.subscribeEvents(
() => this.getRepositories(), "hacs/repository") () => this.getRepositories(), "hacs/repository"
);
} }
@ -130,17 +133,17 @@ class HacsFrontendBase extends LitElement {
</paper-tab> </paper-tab>
${(this.configuration.appdaemon ${(this.configuration.appdaemon
? html`<paper-tab page-name="appdaemon"> ? html`<paper-tab page-name="appdaemon">
${this.hass.localize(`component.hacs.common.appdaemon_apps`)} ${this.hass.localize(`component.hacs.common.appdaemon_apps`)}
</paper-tab>` : "")} </paper-tab>` : "")}
${(this.configuration.python_script ${(this.configuration.python_script
? html`<paper-tab page-name="python_script"> ? html`<paper-tab page-name="python_script">
${this.hass.localize(`component.hacs.common.python_scripts`)} ${this.hass.localize(`component.hacs.common.python_scripts`)}
</paper-tab>` : "")} </paper-tab>` : "")}
${(this.configuration.theme ${(this.configuration.theme
? html`<paper-tab page-name="theme"> ? html`<paper-tab page-name="theme">
${this.hass.localize(`component.hacs.common.themes`)} ${this.hass.localize(`component.hacs.common.themes`)}
</paper-tab>` : "")} </paper-tab>` : "")}

View File

@ -23,7 +23,6 @@ export class CustomRepositories extends LitElement {
public SaveSpinner?: boolean; public SaveSpinner?: boolean;
Delete(ev) { Delete(ev) {
console.log(ev.composedPath()[3].innerText)
if (!window.confirm(this.hass.localize("component.hacs.confirm.delete", "item", ev.composedPath()[3].innerText))) return; if (!window.confirm(this.hass.localize("component.hacs.confirm.delete", "item", ev.composedPath()[3].innerText))) return;
this.hass.connection.sendMessagePromise({ this.hass.connection.sendMessagePromise({
type: "hacs/repository", type: "hacs/repository",