Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit a5bdf14

Browse files
Merge pull request #1592 from l-lin/build/1591/ci_for_demo
ci(#1591): add ci for demo
2 parents 57d8cb8 + ca0c41a commit a5bdf14

File tree

8 files changed

+23647
-3655
lines changed

8 files changed

+23647
-3655
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
---
12
name: build
23

34
on:
45
push:
5-
branches: [ master ]
6+
branches:
7+
- master
68
pull_request:
7-
branches: [ master ]
9+
branches:
10+
- '*'
811

912
# Allows you to run this workflow manually from the Actions tab
1013
workflow_dispatch:
@@ -19,11 +22,26 @@ jobs:
1922
- name: Setup Node
2023
uses: actions/setup-node@v1
2124
with:
22-
node-version: '12.x'
25+
node-version: '16.x'
2326

2427
- name: Install dependencies
2528
run: npm install
2629

2730
- name: Run build
2831
run: npm run build
2932

33+
- name: Pack library
34+
run: npm pack
35+
36+
# test demo
37+
- name: Install demo dependencies
38+
working-directory: ./demo
39+
run: npm install
40+
41+
- name: Install current angular-datatables to demo
42+
working-directory: ./demo
43+
run: rm -rf node_modules/angular-datatables && npm install --no-save --no-package-lock ../angular-datatables-*.tgz
44+
45+
- name: Run demo test
46+
working-directory: ./demo
47+
run: npm run test-ci

demo/karma-ci.conf.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
20+
fixWebpackSourcePaths: true
21+
},
22+
angularCli: {
23+
environment: 'dev'
24+
},
25+
reporters: ['progress', 'kjhtml'],
26+
port: 9876,
27+
colors: true,
28+
logLevel: config.LOG_INFO,
29+
autoWatch: true,
30+
browsers: ['ChromeHeadlessCI'],
31+
customLaunchers: {
32+
ChromeHeadlessCI: {
33+
base: 'ChromeHeadless',
34+
flags: ['--no-sandbox']
35+
}
36+
},
37+
singleRun: true
38+
});
39+
};

0 commit comments

Comments
 (0)