Skip to content

Commit be83aff

Browse files
authored
Merge pull request #2169 from ahnpnl/migrate-to-github-workflows
build(devs-infra): migrate Windows tests to GitHub workflow
2 parents 9218736 + a576c41 commit be83aff

4 files changed

Lines changed: 52 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
4-
name: ci
1+
name: CI
52

63
on:
74
push:
@@ -11,9 +8,6 @@ on:
118
branches:
129
- '**'
1310

14-
env:
15-
CI: true
16-
1711
jobs:
1812
cleanup-runs:
1913
runs-on: ubuntu-latest
@@ -23,9 +17,10 @@ jobs:
2317
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2418
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
2519

26-
lint:
27-
name: Running ESLint
20+
lint-and-typecheck:
21+
name: Running build and lint
2822
runs-on: ubuntu-latest
23+
2924
steps:
3025
- uses: actions/checkout@v2
3126
- name: Get npm cache
@@ -45,22 +40,16 @@ jobs:
4540
- name: Run eslint
4641
run: npm run lint
4742

48-
test:
43+
test-ubuntu:
4944
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
5045
strategy:
5146
fail-fast: false
5247
matrix:
5348
node-version: [10.x, 12.x, 14.x]
54-
os: [ ubuntu-latest ]
49+
os: [ubuntu-latest]
5550
runs-on: ${{ matrix.os }}
5651

5752
steps:
58-
- name: Set git config
59-
shell: bash
60-
run: |
61-
git config --global core.autocrlf false
62-
git config --global core.symlinks true
63-
if: runner.os == 'Windows'
6453
- uses: actions/checkout@v2
6554
- name: Get npm cache
6655
id: npm-cache
@@ -79,21 +68,66 @@ jobs:
7968
run: npm ci
8069
- name: Run tests with coverage
8170
run: npm run test -- --coverage && cat ./coverage/lcov.info
71+
env:
72+
CI: true
8273
- name: Run real repo tests
8374
run: npm run test:external-repos
75+
env:
76+
CI: true
8477
- name: Coveralls parallel
8578
uses: coverallsapp/github-action@master
8679
with:
8780
github-token: ${{ secrets.github_token }}
8881
flag-name: run-${{ matrix.node-version }}
8982
parallel: true
9083

84+
test-windows:
85+
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
node-version: [10.x, 12.x, 14.x]
90+
os: [windows-latest]
91+
runs-on: ${{ matrix.os }}
92+
93+
steps:
94+
- name: Set git config
95+
shell: bash
96+
run: |
97+
git config --global core.autocrlf false
98+
git config --global core.symlinks true
99+
if: runner.os == 'Windows'
100+
- uses: actions/checkout@v2
101+
- name: Get npm cache
102+
id: npm-cache
103+
run: echo "::set-output name=dir::$(npm config get cacheFolder)"
104+
- uses: actions/cache@v2
105+
with:
106+
path: ${{ steps.npm-cache.outputs.dir }}
107+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }}
108+
restore-keys: |
109+
${{ runner.os }}-node-${{ matrix.node-version }}-npm-
110+
- name: Use Node.js ${{ matrix.node-version }}
111+
uses: actions/setup-node@v2.1.2
112+
with:
113+
node-version: ${{ matrix.node-version }}
114+
- name: Install and build
115+
run: npm ci
116+
- name: run unit tests
117+
run: npm run test:unit
118+
- name: run real project tests
119+
run: npm run test:external-repos
120+
env:
121+
CI: true
122+
91123
finish:
92-
needs: test
124+
needs: test-ubuntu
93125
runs-on: ubuntu-latest
94126
steps:
95127
- name: Coveralls finished
96128
uses: coverallsapp/github-action@master
97129
with:
98130
github-token: ${{ secrets.github_token }}
99131
parallel-finished: true
132+
env:
133+
CI: true

.travis.yml

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

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<a href="https://www.npmjs.com/package/ts-jest"><img src="https://img.shields.io/npm/dm/ts-jest.svg?style=flat-square" alt="NPM downloads"/> </a>
99
<a href="https://snyk.io/test/github/kulshekhar/ts-jest"><img src="https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg?style=flat-square" alt="Known vulnerabilities"/> </a>
1010
<a href="https://coveralls.io/github/kulshekhar/ts-jest?branch=master"><img src="https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master" alt="Coverage status"/> </a>
11-
<a href="https://travis-ci.com/kulshekhar/ts-jest"><img src="https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master" alt="Build status"/> </a>
1211
<a href="https://actions-badge.atrox.dev/kulshekhar/ts-jest/goto?ref=master"><img alt="GitHub actions" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fkulshekhar%2Fts-jest%2Fbadge%3Fref%3Dmaster&style=flat-square" /> </a>
1312
<a href="https://github.com/kulshekhar/ts-jest/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/ts-jest.svg?style=flat-square" alt="GitHub license"/> </a>
1413
</p>

docs/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ layout: home
1515
<a href="https://www.npmjs.com/package/ts-jest"><img src="https://img.shields.io/npm/dm/ts-jest.svg?style=flat-square" alt="NPM downloads"/> </a>
1616
<a href="https://snyk.io/test/github/kulshekhar/ts-jest"><img src="https://snyk.io/test/github/kulshekhar/ts-jest/badge.svg?style=flat-square" alt="Known vulnerabilities"/> </a>
1717
<a href="https://coveralls.io/github/kulshekhar/ts-jest?branch=master"><img src="https://coveralls.io/repos/github/kulshekhar/ts-jest/badge.svg?branch=master" alt="Coverage status"/> </a>
18-
<a href="https://travis-ci.com/kulshekhar/ts-jest"><img src="https://travis-ci.com/kulshekhar/ts-jest.svg?branch=master" alt="Build status"/> </a>
1918
<a href="https://actions-badge.atrox.dev/kulshekhar/ts-jest/goto?ref=master"><img alt="GitHub actions" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fkulshekhar%2Fts-jest%2Fbadge%3Fref%3Dmaster&style=flat-square" /> </a>
2019
<a href="https://github.com/kulshekhar/ts-jest/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/ts-jest.svg?style=flat-square" alt="GitHub license"/> </a>
2120
</p>

0 commit comments

Comments
 (0)