Skip to content

Commit 1ab41c1

Browse files
authored
chore: migrate travis-ci.org to github actions (#3629)
* chore: add empty github actions yaml * Update and rename test.yaml to ci.yaml Add gitlab actions ci.yml for better test infra for less.js project! * Update ci.yaml * Update and rename ci.yaml to ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * Add npm cache * Delete unused travis-ci.org CI script yaml file
1 parent c518180 commit 1ab41c1

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Github actions workflow name
2+
name: Nodejs Test
3+
4+
# Triggers the workflow on push or pull request events
5+
on: [push, pull_request]
6+
7+
jobs:
8+
test:
9+
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
10+
strategy:
11+
matrix:
12+
# Test all mainstream operating system
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
# Latest four Nodejs LTS version
15+
node: [10, 12, 14, 16]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
# Pull repo to test machine
19+
- uses: actions/checkout@v2
20+
# Configures the node version used on GitHub-hosted runners
21+
- uses: actions/setup-node@v2
22+
with:
23+
# The Node.js version to configure
24+
node-version: ${{ matrix.node }}
25+
26+
# Caching dependencies to speed up workflows
27+
- name: Get npm cache directory
28+
id: npm-cache-dir
29+
run: |
30+
echo "::set-output name=dir::$(npm config get cache)"
31+
- uses: actions/cache@v2
32+
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
33+
with:
34+
path: ${{ steps.npm-cache-dir.outputs.dir }}
35+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
36+
restore-keys: |
37+
${{ runner.os }}-node-
38+
39+
- name: Install npm dependencies
40+
run: npm install
41+
42+
- name: Print put node & npm version
43+
# Output useful info for debugging.
44+
run: node --version && npm --version
45+
46+
- name: Run unit test
47+
run: cd packages/less && npm test

.travis.yml

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

0 commit comments

Comments
 (0)