Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #110

Merged
merged 2 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
push:
branches: [master]

env:
FORCE_COLOR: 2
NODE: 14.x

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
if: "!contains(github.event.head_commit.message, 'skip ci') && github.repository == 'tancredi/fantasticon'"
name: Release

runs-on: ubuntu-18.04
Expand All @@ -15,9 +19,17 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE }}'
- name: Set up npm cache
uses: actions/cache@v2
with:
node-version: 14
path: ~/.npm
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
- name: Install dependencies
run: npm ci
- name: Build
Expand Down
42 changes: 33 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
name: Test

on: [push, pull_request_target]
on: [push, pull_request]

env:
FORCE_COLOR: 2

jobs:
lint:
name: Lint
env:
NODE: 14.x

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE }}'
- uses: actions/cache@v2
with:
node-version: 14
- run: npm install
path: ~/.npm
key: ${{ matrix.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ matrix.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ matrix.os }}-node-v${{ env.NODE }}-
- run: npm ci
- run: npm run lint

test:
Expand All @@ -23,16 +35,28 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macOS-10.15, ubuntu-18.04, windows-2019]
node-version: [10.x, 12.x, 15.x]
node: [10.x, 12.x, 15.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ matrix.os }}-node-v${{ matrix.node }}-
- run: npm ci
- run: npm run build
- run: npm test