-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Update gitlab and github CI to build with node 18/20
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
image: node:18.16 | ||
|
||
stages: | ||
- test | ||
- build | ||
- deploy | ||
- package | ||
- release | ||
|
||
cache: | ||
key: "$CI_COMMIT_REF_SLUG" | ||
paths: | ||
- node_modules/ | ||
|
||
test: | ||
image: trion/ng-cli-karma | ||
stage: test | ||
script: | ||
- npm install | ||
- npm run test:ci | ||
coverage: '/^Statements\s*:\s*([^%]+)/' | ||
artifacts: | ||
paths: | ||
- coverage/ | ||
- test-report/*.xml | ||
reports: | ||
junit: test-report/*.xml | ||
except: | ||
variables: | ||
- $TEST_DISABLED | ||
|
||
build: | ||
stage: build | ||
script: | ||
- npm install -g @angular/cli | ||
- npm install | ||
- npm run build:prod | ||
artifacts: | ||
paths: | ||
- dist/ | ||
|
||
package: | ||
stage: package | ||
dependencies: | ||
- build | ||
script: | ||
- ./package.sh | ||
artifacts: | ||
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG" | ||
paths: | ||
- "*.tar.gz" | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
when: on_success | ||
allow_failure: false | ||
- if: $CI_MERGE_REQUEST_ID | ||
when: never | ||
- when: manual | ||
allow_failure: true | ||
|
||
# store and publish code coverage HTML report folder | ||
pages: | ||
stage: deploy | ||
needs: | ||
- test | ||
script: | ||
# delete everything in the current public folder | ||
# and replace with code coverage HTML report | ||
- rm -rf public/coverage | ||
- mkdir -p public/coverage | ||
- cp -R coverage/lcov-report/* public/coverage | ||
artifacts: | ||
paths: | ||
- public | ||
expire_in: 30 days | ||
only: | ||
- test | ||
|