From 5b021167b483d1c4385c9eb7bb548452b1fc0ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jefferson=20Gir=C3=A3o?= Date: Mon, 3 Feb 2020 13:23:26 +0100 Subject: [PATCH] chore: fix ci setup and cache node modules --- .github/workflows/frontend.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index f01bf03114..878acfee11 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -4,6 +4,7 @@ on: push: paths: - 'frontend/**' + - '.github/**' jobs: build: @@ -14,11 +15,23 @@ jobs: node-version: [12.x] steps: - - uses: actions/checkout@v1 + - name: checkout code + uses: actions/checkout@v1 + - name: cache node modules + uses: actions/cache@v1 + env: + cache-name: cache-node-modules + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: use node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 - working-directory: ./frontend with: + working-directory: ./frontend node-version: ${{ matrix.node-version }} - name: yarn install, build, and test working-directory: ./frontend @@ -27,4 +40,4 @@ jobs: yarn build --if-present yarn test env: - CI: true + CI: true \ No newline at end of file