From e387442190140204cdbb9d1716fcf9db4c069a61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 22 Apr 2023 23:55:48 +0200 Subject: [PATCH] build(ci): enable dependencies caching with pnpm MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/ci.yml | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 290c1923..749ba7ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,24 +17,25 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: pnpm/action-setup@v2 + with: + version: 8 - name: Setup node ${{ matrix.node }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} + cache: 'pnpm' - name: pnpm install - run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm install - - name: pnpm run lint - run: pnpm run lint - - name: pnpm run build - run: pnpm run build + run: pnpm install + - name: pnpm lint + run: pnpm lint + - name: pnpm build + run: pnpm build - name: pnpm test run: pnpm test - - name: pnpm run coverage + - name: pnpm coverage if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" - run: pnpm run coverage + run: pnpm coverage - name: SonarCloud Scan if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" uses: sonarsource/sonarcloud-github-action@v1.8 @@ -54,24 +55,25 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: pnpm/action-setup@v2 + with: + version: 8 - name: Setup node ${{ matrix.node }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} + cache: 'pnpm' - name: pnpm install - run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm install - - name: pnpm run lint - run: pnpm run lint - - name: pnpm run build - run: pnpm run build + run: pnpm install + - name: pnpm lint + run: pnpm lint + - name: pnpm build + run: pnpm build - name: pnpm test run: pnpm test - # - name: pnpm run coverage + # - name: pnpm coverage # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" - # run: pnpm run coverage + # run: pnpm coverage # - name: SonarCloud Scan # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'" # uses: sonarsource/sonarcloud-github-action@v1.8 -- 2.34.1