From 4a197fdb7fee881e90c033ac80d7031336999609 Mon Sep 17 00:00:00 2001 From: metonym Date: Thu, 10 Feb 2022 08:28:07 -0800 Subject: [PATCH] ci: adjust run rules, use cache actions (#1081) - adjust run rules to run on any pull request or a push to `master` - use action to cache install folder to speed up builds - run `build:api` and `build:lib` in parallel --- .github/workflows/ci.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4684f648..9ffa1ec6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,27 @@ name: CI -on: [pull_request] + +on: + pull_request: + push: + branches: + - master + jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + id: yarn-cache + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - name: Install dependencies and build the library run: | yarn - yarn build:api - yarn build:lib + yarn build:api & yarn build:lib + - name: Run unit tests and validate TypeScript definitions run: yarn test