|
| 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 | + |
0 commit comments