2019-11-13 18:53:31 +01:00
|
|
|
name: Test
|
2019-11-13 18:43:58 +01:00
|
|
|
|
2019-11-19 22:56:37 +01:00
|
|
|
on: [push]
|
2019-11-13 18:43:58 +01:00
|
|
|
|
|
|
|
jobs:
|
2019-11-14 01:22:14 +01:00
|
|
|
test:
|
2019-11-13 18:43:58 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2019-11-18 23:02:57 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: ['10', '12', '13']
|
|
|
|
|
2019-11-13 18:43:58 +01:00
|
|
|
steps:
|
2019-11-13 18:53:31 +01:00
|
|
|
- uses: actions/checkout@v1
|
2019-11-18 23:02:57 +01:00
|
|
|
|
2019-11-13 18:53:31 +01:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2019-11-18 23:02:57 +01:00
|
|
|
node-version: ${{ matrix.node-version }}
|
2019-11-13 18:53:31 +01:00
|
|
|
|
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2019-11-14 01:02:49 +01:00
|
|
|
path: ~/.npm
|
2019-11-19 23:27:17 +01:00
|
|
|
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}-
|
2019-11-14 01:02:49 +01:00
|
|
|
|
|
|
|
- name: Cache Gatsby build output
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: public
|
|
|
|
key: ${{ runner.os }}-public
|
2019-11-13 18:53:31 +01:00
|
|
|
|
2019-11-18 23:02:57 +01:00
|
|
|
- run: npm ci
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run build
|
2019-11-13 18:53:31 +01:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
GATSBY_GITHUB_TOKEN: ${{ secrets.GATSBY_GITHUB_TOKEN }}
|