Skip to content

Commit

Permalink
chore: migrate travis-ci.org to github actions (#3629)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
iChenLei authored Jul 3, 2021
1 parent c518180 commit 1ab41c1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 14 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Github actions workflow name
name: Nodejs Test

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
test:
name: 'Tests on ${{matrix.os}} with node${{matrix.node}}'
strategy:
matrix:
# Test all mainstream operating system
os: [ubuntu-latest, macos-latest, windows-latest]
# Latest four Nodejs LTS version
node: [10, 12, 14, 16]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
- uses: actions/checkout@v2
# Configures the node version used on GitHub-hosted runners
- uses: actions/setup-node@v2
with:
# The Node.js version to configure
node-version: ${{ matrix.node }}

# Caching dependencies to speed up workflows
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm dependencies
run: npm install

- name: Print put node & npm version
# Output useful info for debugging.
run: node --version && npm --version

- name: Run unit test
run: cd packages/less && npm test
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

0 comments on commit 1ab41c1

Please sign in to comment.