Skip to content

Commit

Permalink
chore: add github actions ci
Browse files Browse the repository at this point in the history
  • Loading branch information
iChenLei committed Oct 16, 2021
1 parent 8291e5d commit 1e6f89f
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 69 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Github actions workflow name
name: CI

# Triggers the workflow on push or pull request events
on:
push:
branches: [main, master]
tags: ['**']
pull_request:
branches:
- master

jobs:
node_tests:
name: 'Test nib on ${{matrix.os}} with node${{matrix.node}}'
strategy:
matrix:
os: [ubuntu-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 Test
run: npm test
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[![Build Status](https://travis-ci.org/stylus/nib.svg?branch=master)](https://travis-ci.org/stylus/nib)
# Nib [![npm](https://img.shields.io/npm/v/nib)](https://www.npmjs.com/package/nib) [![build status](https://github.com/stylus/nib/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stylus/nib/actions/workflows/ci.yml)

# Nib

Stylus mixins, utilities, components, and gradient image generation. Don't forget to check out the [documentation](http://stylus.github.io/nib/).
Stylus mixins, utilities, components, and gradient image generation. Don't forget to check out the [documentation](http://stylus.github.io/nib).

## Installation

Expand Down
107 changes: 52 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/visionmedia/nib.git"
"url": "git://github.com/stylus/nib.git"
},
"dependencies": {
"stylus": "^0.54.8"
"peerDependencies": {
"stylus": "*"
},
"devDependencies": {
"stylus": ">= 0.55.0",
"connect": "1.x",
"jade": "0.22.0",
"mocha": "*",
Expand All @@ -22,7 +23,7 @@
"node": "*"
},
"scripts": {
"test": "mocha",
"test": "mocha test/runner.js",
"test-server": "node test/server.js"
}
}

0 comments on commit 1e6f89f

Please sign in to comment.