Add cache to build workflow
This commit is contained in:
@@ -6,8 +6,8 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
# TODO Fix tests in Windows
|
# TODO Fix tests in Windows
|
||||||
# os: [macOS-latest, ubuntu-latest, windows-latest]
|
# os: [macOS-latest, ubuntu-latest, windows-latest]
|
||||||
os: [macOS-latest, ubuntu-latest]
|
os: [macOS-latest, ubuntu-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -20,7 +20,16 @@ jobs:
|
|||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
id: cache-go
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
- name: Download dependencies
|
- name: Download dependencies
|
||||||
|
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
@@ -36,16 +45,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 13
|
node-version: 13
|
||||||
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
id: cache-npm
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('ui/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: npm install dependencies
|
- name: npm install dependencies
|
||||||
run: |
|
run: |
|
||||||
cd ui
|
cd ui
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
# TODO: Enable when there are tests to run
|
# TODO: Enable when there are tests to run
|
||||||
# - name: npm test
|
# - name: npm test
|
||||||
# run: |
|
# run: |
|
||||||
# cd ui
|
# cd ui
|
||||||
# CI=test npm test
|
# CI=test npm test
|
||||||
|
|
||||||
- name: npm build
|
- name: npm build
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user