Skip to content

Commit e00c500

Browse files
committed
ci: move to GH actions and npm
1 parent 077ecb5 commit e00c500

File tree

19 files changed

+94
-14129
lines changed

19 files changed

+94
-14129
lines changed

.circleci/config.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ci
2+
3+
on: pull_request
4+
5+
jobs:
6+
build_and_test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [12.x]
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
- name: install
19+
run: npm install
20+
- name: build
21+
run: npm run build --skip-nx-cache
22+
- name: test
23+
run: npm run test --ci --code-coverage

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
if: github.repository == 'testing-library/angular-testing-library'
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [12.x]
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: install
23+
run: npm install
24+
- name: build
25+
run: npm run build --skip-nx-cache
26+
- name: test
27+
run: npm run test --ci --code-coverage
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: npx semantic-release

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
registry=http://registry.npmjs.org/
1+
registry=http://registry.npmjs.org/
2+
package-lock=false

angular.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"options": {
7979
"jestConfig": "apps/example-app/jest.config.js",
8080
"tsConfig": "apps/example-app/tsconfig.spec.json",
81-
"setupFile": "apps/example-app/setup-jest.ts"
81+
"setupFile": "apps/example-app/test-setup.ts"
8282
}
8383
}
8484
}
@@ -134,7 +134,7 @@
134134
"options": {
135135
"jestConfig": "projects/testing-library/jest.config.js",
136136
"tsConfig": "projects/testing-library/tsconfig.spec.json",
137-
"setupFile": "projects/testing-library/setup-jest.ts"
137+
"setupFile": "projects/testing-library/test-setup.ts"
138138
}
139139
}
140140
}
@@ -181,7 +181,7 @@
181181
"options": {
182182
"jestConfig": "projects/jest-utils/jest.config.js",
183183
"tsConfig": "projects/jest-utils/tsconfig.spec.json",
184-
"setupFile": "projects/jest-utils/setup-jest.ts"
184+
"setupFile": "projects/jest-utils/test-setup.ts"
185185
}
186186
}
187187
}

apps/example-app/app/examples/13-scrolling.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { render, screen, waitForElementToBeRemoved } from '@testing-library/angular';
22

3-
import { CdkVirtualScrollOverviewExample } from './13-scrolling.component';
3+
import { CdkVirtualScrollOverviewExampleComponent } from './13-scrolling.component';
44
import { ScrollingModule } from '@angular/cdk/scrolling';
55

66
test('should scroll to load more items', async () => {
7-
await render(CdkVirtualScrollOverviewExample, {
7+
await render(CdkVirtualScrollOverviewExampleComponent, {
88
imports: [ScrollingModule],
99
});
1010

apps/example-app/app/examples/13-scrolling.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChangeDetectionStrategy, Component } from '@angular/core';
22

33
@Component({
4-
selector: 'cdk-virtual-scroll-overview-example',
4+
selector: 'app-cdk-virtual-scroll-overview-example',
55
template: `
66
<cdk-virtual-scroll-viewport itemSize="50" class="example-viewport" data-testid="scroll-viewport">
77
<div *cdkVirtualFor="let item of items" class="example-item">{{ item }}</div>
@@ -22,6 +22,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
2222
],
2323
changeDetection: ChangeDetectionStrategy.OnPush,
2424
})
25-
export class CdkVirtualScrollOverviewExample {
25+
export class CdkVirtualScrollOverviewExampleComponent {
2626
items = Array.from({ length: 100 }).map((_, i) => `Item #${i}`);
2727
}
File renamed without changes.

apps/example-app/tsconfig.spec.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"module": "commonjs",
5-
"types": ["jest", "node"]
6-
}
5+
"types": ["node", "jest"]
6+
},
7+
"files": ["test-setup.ts"],
8+
"include": ["**/*.spec.ts", "**/*.d.ts"]
79
}

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,20 @@ module.exports = {
66
resolver: '@nrwl/jest/plugins/resolver',
77
moduleFileExtensions: ['ts', 'js', 'html'],
88
coverageReporters: ['html'],
9+
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
910
snapshotSerializers: [
1011
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
1112
'jest-preset-angular/build/AngularSnapshotSerializer.js',
1213
'jest-preset-angular/build/HTMLCommentSerializer.js',
1314
],
15+
globals: {
16+
'ts-jest': {
17+
tsConfig: '<rootDir>/tsconfig.spec.json',
18+
stringifyContentPathRegex: '\\.(html|svg)$',
19+
astTransformers: [
20+
'jest-preset-angular/build/InlineFilesTransformer',
21+
'jest-preset-angular/build/StripStylesTransformer',
22+
],
23+
},
24+
},
1425
};

0 commit comments

Comments
 (0)