From d82d2ebc626df4e9446d55b0835101990b539a49 Mon Sep 17 00:00:00 2001 From: marvin19 Date: Sun, 11 Feb 2024 14:08:18 +0100 Subject: [PATCH] Added caching to workflow. --- .github/workflows/unit-test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index dca3f066..0fc2a499 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -9,19 +9,28 @@ on: jobs: unit-test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 + name: Checkout repository 🫠 - name: Setup Node uses: actions/setup-node@v3 + - uses: actions/cache@v3 + id: npm-cache + with: + path: ~/.npm + key: npm-${{ hashFiles('**/package-lock.json') }} - run: npm ci - run: npm test build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 + - uses: actions/cache@v3 + id: npm-cache + with: + path: ~/.npm + key: npm-${{ hashFiles('**/package-lock.json') }} - run: npm ci - run: npm run build