From e75ba8b065b98e28ef7f21243b93e9e3416f9b25 Mon Sep 17 00:00:00 2001 From: Tadayoshi Sato Date: Sat, 18 Jun 2022 14:35:26 +0900 Subject: [PATCH] chore: add test workflow --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..1a9d0e2f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Test + +on: + pull_request: + branches: + - main + paths-ignore: + - "**.md" + push: + branches: + - main + paths-ignore: + - "**.md" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node: [ '14', '16' ] + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install + run: yarn install + - name: Build + run: yarn build + - name: Test + run: yarn test