1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-23 01:30:01 +01:00
blog/.github/workflows/test.yml

40 lines
926 B
YAML
Raw Normal View History

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