From 59571b8aed8e27f720a416c8832e4a7c0ed1c8b1 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Tue, 31 Oct 2023 09:03:45 +0300 Subject: [PATCH] ci: use node 20 and setup caching --- .github/workflows/lint.yaml | 23 ++++++++++++----------- .github/workflows/test.yaml | 13 +++++++++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 73a50906b..ca40b9106 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,4 +1,3 @@ - name: Lint on: push: @@ -6,20 +5,22 @@ on: - main pull_request: paths: - - 'Makefile' - - '**.jsx?' - - '**.tsx?' - - '**/.babelrc' - - '**/.eslint*' - - '**/.prettierrc*' - - '**/package.json' - - '**/github/workflows/lint.yml' + - "Makefile" + - "**.jsx?" + - "**.tsx?" + - "**/.babelrc" + - "**/.eslint*" + - "**/.prettierrc*" + - "**/package.json" + - "**/github/workflows/lint.yml" jobs: eslint: runs-on: ubuntu-latest - container: - image: node:16-alpine steps: - uses: actions/checkout@master + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" - run: npm i - run: npm run lint:eslint diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 77551a364..69a07b3da 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,10 +13,12 @@ name: Test jobs: test: runs-on: ubuntu-latest - container: - image: node:16-alpine steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" - run: npm i - run: npm run test:ci @@ -32,11 +34,14 @@ jobs: with: projectToken: ${{ secrets.CHROMATIC_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }} + production-build: runs-on: ubuntu-latest - container: - image: node:16-alpine steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" - run: npm i - run: npm run build