From 3e55082b3f4442dffd4a2b99fea351001d848b56 Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Wed, 9 Oct 2019 00:20:05 +0900 Subject: [PATCH] gha: Use setup-node (#58) * config: Add .nvmrc * gha: Add setup-node step * gha: Add step to read .nvmrc Close #55 --- .github/workflows/test.yml | 14 ++++++++++++-- .nvmrc | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db8432e..f0c3d67 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,17 @@ jobs: with: fetch-depth: 1 + - name: Read .nvmrc + run: echo ::set-output name=NVMRC::$(cat .nvmrc) + id: nvm + + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: '${{ steps.nvm.outputs.NVMRC }}' + - name: Install dependencies - run: npm ci + run: npm install - name: Format check run: npm run format:check @@ -28,7 +37,8 @@ jobs: - name: Test run: npm test - - uses: actions/upload-artifact@master + - name: Upload test coverage + uses: actions/upload-artifact@master with: name: coverage path: coverage diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8ba6916 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +12.11.1