From 4a1b3500fd10307febb07a5e613b134c61b179a1 Mon Sep 17 00:00:00 2001 From: Kenrick Date: Sat, 18 Apr 2020 11:30:39 +0800 Subject: [PATCH 1/3] Create nodejs.yml --- .github/workflows/nodejs.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..0b01041 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,39 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x] + + steps: + - uses: actions/checkout@v2 + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-yarn- + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: run tests + run: yarn workspace @kenrick95/c4 test + env: + CI: true From 2ce91b1660a197c363e98bb0fd2842d7385c1ff2 Mon Sep 17 00:00:00 2001 From: Kenrick Date: Sat, 18 Apr 2020 11:32:04 +0800 Subject: [PATCH 2/3] Update nodejs.yml --- .github/workflows/nodejs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0b01041..a156d42 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,6 +33,8 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: install + run: yarn install - name: run tests run: yarn workspace @kenrick95/c4 test env: From 1bcd94de2c137e3ebb8734bfe493a4e73a5f3420 Mon Sep 17 00:00:00 2001 From: Kenrick Date: Sat, 18 Apr 2020 11:34:32 +0800 Subject: [PATCH 3/3] Update --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a156d42..f688d23 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x] + node-version: [12.x] steps: - uses: actions/checkout@v2