1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-08 14:47:28 +00:00

Added GitHub Actions Node.js CI Workflow

This commit is contained in:
Bharat Middha
2020-01-03 15:45:09 -06:00
parent 0179afee0e
commit afa9401ef1

35
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: CI
on: [push, pull_request]
jobs:
build-node:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
env:
CI: true