Skip to content

Commit

Permalink
feat(module: workflow): add github actions flow (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshmyw authored Jul 28, 2022
1 parent 416845f commit 8b59b31
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 67 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pull Request CI
# master 分支发生PR事件时触发运行工作流程
on:
pull_request:
branches: master

jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
task: [test-headless, pre-release]

steps:
# 拉取代码
- name: Checkout repository
uses: actions/checkout@v3

# 设置 node 环境
- name: Setup Node.js env
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}

# 安装依赖
- name: Installing Dependencies
run: |
npm install
# 执行单测 or pre-release # or see https://medium.com/rupesh-tiwari/how-to-deploy-angular-apps-to-github-pages-gh-pages-setup-ci-cd-for-angular-app-with-github-714c1e555de5
- name: Run Task ${{matrix.task}}
run: npm run ${{matrix.task}}
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions components/range/range.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ describe('RangeComponent', () => {
const sliderCoords = amSlider.getBoundingClientRect();
const sliderLength = sliderCoords.width;
const sliderStart = sliderCoords.left;
const offset = Math.round(((400 - sliderStart) / sliderLength) * 100);
const offset = Math.round(((300 - sliderStart) / sliderLength) * 100);

const sliderHandlerNodeList = rangeEle.nativeElement.querySelectorAll('sliderhandle');
dispatchMouseEvent(sliderHandlerNodeList[0], 'mousedown');
fixture.detectChanges();
dispatchMouseEvent(document, 'mousemove', 400);
dispatchMouseEvent(document, 'mousemove', 300);
fixture.detectChanges();
dispatchMouseEvent(document, 'mouseup');
sliderHandler = rangeEle.nativeElement.querySelectorAll('.am-slider-handle');
Expand Down
33 changes: 0 additions & 33 deletions karma.conf.js

This file was deleted.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "npm run site:init && node --max_old_space_size=5120 node_modules/@angular/cli/bin/ng serve --port=4300",
"build": "node ./scripts/site/generate-site init && node --max_old_space_size=5120 node_modules/@angular/cli/bin/ng build --aot --configuration production --output-hashing none",
"test": "npm run site:init && ng test --watch=false --code-coverage",
"test-headless": "npm run site:init && ng test --watch=false --code-coverage --browsers=ChromeHeadless",
"test-watch": "npm run site:init && ng test --watch=true --code-coverage",
"release": "node --max_old_space_size=5120 ./scripts/publish/publish.js",
"publish": "bash ./scripts/publish/publish.sh",
Expand Down Expand Up @@ -101,6 +102,7 @@
"prettier": "^1.18.2",
"prismjs": "^1.10.0",
"protractor": "^7.0.0",
"puppeteer": "^15.5.0",
"raw-loader": "^4.0.2",
"readline-sync": "^1.4.9",
"remark": "~10.0.1",
Expand Down

0 comments on commit 8b59b31

Please sign in to comment.