From 3e16f13c5c162588dfcd90f257e2951fa8867e17 Mon Sep 17 00:00:00 2001 From: Mathusan Selvakumar <89030828+mathusanMe@users.noreply.github.com> Date: Sun, 19 Nov 2023 12:22:06 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9e29618..6dae7104 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,26 @@ name: Java CI on: [push, pull_request] jobs: + setup_node: + runs-on: ubuntu-latest + outputs: + cache-key: ${{ steps.cache-key.outputs.key }} + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Node.js 16 + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Cache node modules + id: cache-key + run: echo "::set-output name=key::$(echo \"Node.js\")-$(echo ${{ hashFiles('**/package-lock.json') }})" + build: + needs: setup_node runs-on: ubuntu-latest container: @@ -28,7 +47,7 @@ jobs: run: ./run.sh compile build_test: - needs: build + needs: [setup_node, build] runs-on: ubuntu-latest container: @@ -47,7 +66,7 @@ jobs: run: ./run.sh compileTests test: - needs: build_test + needs: [setup_node, build_test] runs-on: ubuntu-latest container: