Skip to content

Commit d90f317

Browse files
author
Dennis Labordus
committed
Small fixes and update of the Github Actions.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 9932bf2 commit d90f317

File tree

9 files changed

+61
-40
lines changed

9 files changed

+61
-40
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
version: 2
6+
7+
updates:
8+
# Maintain dependencies for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
open-pull-requests-limit: 5

.github/workflows/build-project.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Build Project
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
- '!main'
8+
pull_request:
9+
branches:
10+
- 'main'
411

512
jobs:
613
build:
@@ -9,16 +16,27 @@ jobs:
916
timeout-minutes: 15
1017

1118
steps:
12-
- uses: actions/checkout@v2
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
1322
- name: Use Node.js 14.x
1423
uses: actions/setup-node@v1
1524
with:
1625
node-version: '14.x'
26+
27+
- name: Test application with npm
28+
if: ${{ github.event_name == 'push' }}
29+
run: |
30+
npm ci
31+
npm run-script test
32+
1733
- name: Build application with npm
34+
if: ${{ github.event_name == 'pull_request' }}
1835
run: |
1936
npm ci
2037
npm run-script build
2138
- name: Build docker image
39+
if: ${{ github.event_name == 'pull_request' }}
2240
uses: docker/build-push-action@v2
2341
with:
2442
# Set the context to use the current directory and not execute it's own git checkout.

.github/workflows/release-project.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,22 @@ jobs:
1313
name: Build and publish
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Check out the repo
16+
- name: Checkout
1717
uses: actions/checkout@v2
18+
- name: Set up Docker Buildx
19+
id: buildx
20+
uses: docker/setup-buildx-action@v1
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v1
23+
with:
24+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
25+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
26+
- name: Cache Docker Register
27+
uses: actions/cache@v2
28+
with:
29+
path: /tmp/.buildx-cache
30+
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
31+
1832
- name: Extract tag name
1933
id: extract_tagname
2034
shell: bash
@@ -24,15 +38,11 @@ jobs:
2438
uses: actions/setup-node@v1
2539
with:
2640
node-version: '14.x'
41+
2742
- name: Build application with npm
2843
run: |
2944
npm ci
3045
npm run-script build
31-
- name: Login to Docker Hub
32-
uses: docker/login-action@v1
33-
with:
34-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
35-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
3646
- name: Build and push docker image to Docker Hub
3747
uses: docker/build-push-action@v2
3848
with:

__snapshots__/compas-scltype-list.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,7 @@
4141
tabindex="0"
4242
>
4343
<span>
44-
<description>
45-
System Exchange Description
46-
</description>
47-
(
48-
<code>
49-
SED
50-
</code>
51-
)
44+
System Exchange Description (SED)
5245
</span>
5346
</mwc-list-item>
5447
<mwc-list-item
@@ -57,14 +50,7 @@
5750
tabindex="-1"
5851
>
5952
<span>
60-
<description>
61-
Substation Specification Description
62-
</description>
63-
(
64-
<code>
65-
SSD
66-
</code>
67-
)
53+
Substation Specification Description (SSD)
6854
</span>
6955
</mwc-list-item>
7056
</mwc-list>

__snapshots__/compas-scltype-radiogroup.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@
4444
value="SED"
4545
>
4646
<span>
47-
<description>
48-
System Exchange Description
49-
</description>
50-
(SED)
47+
System Exchange Description (SED)
5148
</span>
5249
</mwc-radio-list-item>
5350
<mwc-radio-list-item
@@ -59,10 +56,7 @@
5956
value="SSD"
6057
>
6158
<span>
62-
<description>
63-
Substation Specification Description
64-
</description>
65-
(SSD)
59+
Substation Specification Description (SSD)
6660
</span>
6761
</mwc-radio-list-item>
6862
</mwc-list>

src/compas-editors/CompasVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default class CompasVersionsPlugin extends LitElement {
132132
`
133133
}
134134

135-
if (this.scls?.length <= 0) {
135+
if (this.scls.length <= 0) {
136136
return html `
137137
<mwc-list>
138138
<mwc-list-item>

src/compas-services/foundation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export function parseXml(textContent: string): Promise<Document> {
6060

6161
export function extractSclFromResponse(response: Document): Promise<Document> {
6262
// Extract the SCL Result from the Response and create a new Document from it.
63-
const sclData = response.querySelectorAll("SclData").item(0).textContent;
64-
const sclDocument = new DOMParser().parseFromString(sclData??'', 'application/xml');
63+
const sclData = response.querySelectorAll("SclData").item(0).textContent ?? '';
64+
const sclDocument = new DOMParser().parseFromString(sclData, 'application/xml');
6565
return Promise.resolve(sclDocument);
6666
}
6767

src/compas/CompasSclTypeList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ export class CompasSclTypeList extends LitElement {
4949
return html`
5050
<mwc-list>
5151
${this.sclTypes.map( type => {
52-
const code = type.getElementsByTagNameNS(SDS_NAMESPACE, "Code").item(0);
53-
const description = type.getElementsByTagNameNS(SDS_NAMESPACE, "Description").item(0);
52+
const code = type.getElementsByTagNameNS(SDS_NAMESPACE, "Code").item(0)!.textContent ?? '';
53+
const description = type.getElementsByTagNameNS(SDS_NAMESPACE, "Description").item(0)!.textContent ?? '';
5454
return html`<mwc-list-item tabindex="0"
55-
@click=${() => this.dispatchEvent(newTypeSelectedEvent(code!.textContent ?? ''))}>
55+
@click=${() => this.dispatchEvent(newTypeSelectedEvent(code))}>
5656
<span>${description} (${code})</span>
5757
</mwc-list-item>`;
5858
})}

src/compas/CompasSclTypeRadiogroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export class CompasSclTypeRadiogroup extends LitElement {
5454
<mwc-list activatable>
5555
${this.sclTypes.map( type => {
5656
const code = type.getElementsByTagNameNS(SDS_NAMESPACE, "Code").item(0)!.textContent ?? '';
57-
const description = type.getElementsByTagNameNS(SDS_NAMESPACE, "Description").item(0);
58-
return html`<mwc-radio-list-item value="${code ?? ''}" ?selected="${(code === this.value)}" left>
57+
const description = type.getElementsByTagNameNS(SDS_NAMESPACE, "Description").item(0)!.textContent ?? '';
58+
return html`<mwc-radio-list-item value="${code}" ?selected="${(code === this.value)}" left>
5959
<span>${description} (${code})</span>
6060
</mwc-radio-list-item>`;
6161
})}

0 commit comments

Comments
 (0)