From f12e7f577a94f0dacfabdd8054f26cf29068078d Mon Sep 17 00:00:00 2001 From: Alex H Date: Sun, 3 Mar 2024 16:16:51 +0100 Subject: [PATCH] ci: Debug ci --- .github/actions/action.yml | 2 ++ .github/workflows/bump-version.yml | 14 +++++++++----- .github/workflows/ci.yml | 11 ++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/actions/action.yml b/.github/actions/action.yml index 61af3a6..1eeb890 100644 --- a/.github/actions/action.yml +++ b/.github/actions/action.yml @@ -13,6 +13,8 @@ runs: with: path: | node_modules + .nx + .angular ~/.cache/Cypress # needed for the Cypress binary key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package-lock.json') }} - name: Npm install diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 9e46f6c..bbb9ac6 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -27,6 +27,14 @@ jobs: run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source' - name: Upload test coverage badge run: npx nx affected -t upload-badge --parallel=3 --exclude='json-api-front,json-api-server,shared-utils,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source' + - name: Cache npm dependencies + id: cache-dependencies-save + uses: actions/cache/save@v4 + with: + path: | + .nx + .angular + key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} # env: # GIST_SECRET: ${{ secrets.GIST_SECRET }} # GIST_ID: ${{ secrets.GIST_ID }} @@ -48,11 +56,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Checkout and install + - name: Npm install uses: ./.github/actions - name: Bump version run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d3a12a..0418563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,15 @@ jobs: uses: ./.github/actions # This line is needed for nx affected to work when CI is running on a PR - run: git branch --track main origin/master - - run: npx nx affected -t lint test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,shared-utils,json-shared-type,database' + - name: Test and build + run: npx nx affected -t lint test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,shared-utils,json-shared-type,database' + - name: Cache npm dependencies + id: cache-dependencies-save + uses: actions/cache/save@v4 + with: + path: | + .nx + .angular + key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} # - run: npm nx affected -t e2e-ci --parallel=1 # - run: npm nx affected -t deploy --no-agents