Skip to content

Commit 36f6808

Browse files
spike-rabbitfh1ch
authored andcommitted
build: setup gh actions
1 parent a9e8731 commit 36f6808

File tree

6 files changed

+90
-13
lines changed

6 files changed

+90
-13
lines changed

.github/workflows/build.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- maintenance/*
7+
- next
8+
pull_request:
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # We need this for commit-lint
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/jod
19+
cache: 'npm'
20+
- run: npm config set //code.siemens.com/api/v4/packages/npm/:_authToken $SIEMENS_NPM_TOKEN
21+
env:
22+
SIEMENS_NPM_TOKEN: ${{ secrets.SIEMENS_NPM_TOKEN }}
23+
- run: npm ci --prefer-offline --no-audit --include=optional
24+
- run: npm run lint:commit
25+
- run: npm run build:all
26+
- run: npm run build:examples
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: dist
30+
path: dist
31+
32+
test:
33+
runs-on: ubuntu-22.04
34+
# We use playwright browser to run karma tests
35+
container: mcr.microsoft.com/playwright:v1.52.0-noble
36+
env:
37+
# See: https://github.com/microsoft/playwright/issues/27620
38+
HOME: /root
39+
needs:
40+
- build
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v4
44+
with:
45+
node-version: lts/jod
46+
cache: 'npm'
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: dist
50+
path: dist
51+
- run: npm ci --prefer-offline --no-audit
52+
- run: npm run lint:format
53+
- run: npm run lint:ng
54+
- run: npm run translate:test -- --watch=false --progress=false --code-coverage
55+
- run: npm run lib:test -- --watch=false --progress=false --code-coverage
56+
# TODO: Upload coverage reports
57+
58+
aot:
59+
runs-on: ubuntu-22.04
60+
needs:
61+
- build
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: lts/jod
67+
cache: 'npm'
68+
- uses: actions/download-artifact@v4
69+
with:
70+
name: dist
71+
path: dist
72+
- run: npm config set //code.siemens.com/api/v4/packages/npm/:_authToken $SIEMENS_NPM_TOKEN
73+
env:
74+
SIEMENS_NPM_TOKEN: ${{ secrets.SIEMENS_NPM_TOKEN }}
75+
- run: npm ci --prefer-offline --no-audit --include=optional
76+
- run: npm run build:examples:aot
77+
- run: npm run build:all:update-translatable-keys
78+
- run: git diff --exit-code "projects/**/*-translatable-keys.interface.ts"
79+
# TODO: build design system
80+
# TODO: add release job
81+
# TODO: build PR previews
82+
# TODO: e2e test
83+

karma.shared.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports.buildConfig = (config, { name, testSuite }) => ({
5050
reporters: [{ type: 'html' }, { type: 'cobertura' }, { type: 'text-summary' }],
5151
check: {
5252
global: {
53-
lines: 80
53+
lines: 70 // TODO: increase once every test is migrated
5454
}
5555
}
5656
},

projects/element-translate-ng/localize-types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright Siemens 2016 - 2025.
33
* SPDX-License-Identifier: MIT
44
*/
5-
import { TranslatableString } from '@simpl-labs/siemens-element-translate-ng/translate-types';
5+
import { TranslatableString } from '@siemens/element-translate-ng/translate-types';
66

77
declare global {
88
let $localize: (strings: TemplateStringsArray, ...expressions: string[]) => TranslatableString;

projects/live-preview/esbuild-component-loader.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { globIterate } from 'glob';
44
const livePreviewComponentLoader = {
55
name: 'live-preview-component-loader',
66
setup: build => {
7-
build.onResolve({ filter: /@simpl-labs\/siemens-live-preview\/component-loader.*/ }, args => {
7+
build.onResolve({ filter: /@siemens\/live-preview\/component-loader.*/ }, args => {
88
const [data] = args.path.split('!');
99
const url = new URL('fake:' + data);
1010
const root = url.searchParams.get('root');
@@ -24,7 +24,7 @@ const livePreviewComponentLoader = {
2424

2525
build.onLoad(
2626
{
27-
filter: /@simpl-labs\/siemens-live-preview\/component-loader.*/,
27+
filter: /@siemens\/live-preview\/component-loader.*/,
2828
namespace: 'live-preview-component-loader'
2929
},
3030
async ({ pluginData: { root, webcomponents, examples } }) => {

src/tsconfig.app.prod.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"@siemens/element-ng": ["dist/@siemens/element-ng"],
77
"@siemens/element-ng/*": ["dist/@siemens/element-ng/*"],
88
"@siemens/element-translate-ng": ["dist/@siemens/element-translate-ng"],
9-
"@siemens/element-translate-ng/*": [
10-
"dist/@siemens/element-translate-ng/*"
11-
],
9+
"@siemens/element-translate-ng/*": ["dist/@siemens/element-translate-ng/*"],
1210
"@siemens/live-preview": ["dist/@siemens/live-preview"],
1311
"@siemens/live-preview/*": ["dist/@siemens/live-preview/*"]
1412
},

tsconfig.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121
"paths": {
2222
"@siemens/element-ng": ["projects/element-ng/public-api.ts"],
2323
"@siemens/element-ng/*": ["projects/element-ng/*"],
24-
"@siemens/element-translate-ng": [
25-
"dist/@siemens/element-translate-ng/public-api.ts"
26-
],
27-
"@siemens/element-translate-ng/*": [
28-
"dist/@siemens/element-translate-ng/*"
29-
],
24+
"@siemens/element-translate-ng": ["dist/@siemens/element-translate-ng/public-api.ts"],
25+
"@siemens/element-translate-ng/*": ["dist/@siemens/element-translate-ng/*"],
3026
"@siemens/live-preview": ["projects/live-preview/public-api.ts"],
3127
"@siemens/live-preview/*": ["projects/live-preview/*"]
3228
}

0 commit comments

Comments
 (0)