AdminLTE/.github/workflows/ci.yml
XhmikosR 7d42f7cceb
Tweak CI cache (#2904)
Enable cache on Windows and fix cache directory to work on all OS'es
2020-07-22 15:53:08 +02:00

64 lines
1.5 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- "**"
env:
CI: true
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node:
- "10.x"
- "12.x"
- "14.x"
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
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 npm dependencies
run: npm ci
- name: Build files
run: npm run compile
- name: Run bundlewatch
run: npm run bundlewatch
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '12')
env:
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"