From 076ee492388ba000ebdfa49d9f4356562c8bef19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abraham=20Javier=20P=C3=A9rez=20Bautista?= <75546736+ajperezbau@users.noreply.github.com> Date: Thu, 11 May 2023 11:25:11 +0100 Subject: [PATCH] ci: restore build workflow (#1194) --- .github/workflows/build.yml | 81 +++--------------------- nx.json | 2 +- package.json | 4 +- packages/deep-merge/package.json | 2 +- packages/jest-utils/CHANGELOG.md | 10 +++ packages/jest-utils/package.json | 2 +- packages/logger/CHANGELOG.md | 9 +++ packages/logger/package.json | 4 +- packages/storage-service/package.json | 2 +- packages/x-adapter-platform/package.json | 2 +- packages/x-adapter/package.json | 2 +- packages/x-archetype-utils/package.json | 2 +- packages/x-bus/package.json | 2 +- packages/x-priority-queue/package.json | 2 +- packages/x-svg-converter/package.json | 2 +- packages/x-translations/package.json | 2 +- packages/x-utils/package.json | 2 +- 17 files changed, 43 insertions(+), 89 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 130359f13e..8af69f8715 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: ci +name: Check branch is releasable and release alpha on main branch update on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -6,10 +6,6 @@ concurrency: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - task: [lint, 'test:unit', 'test:unit-cypress', 'test:e2e:ci'] - name: ${{ matrix.task }} container: image: cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 # https://github.com/cypress-io/github-action#firefox Cypress FF image needs this user permissions to be able to install dependencies @@ -47,84 +43,25 @@ jobs: ${{ runner.os }}-pnpm-store- - name: setup eslint cache - if: ${{ matrix.task == 'lint' }} uses: actions/cache@v3 with: path: '**/.eslintcache' key: eslint-${{github.sha}} restore-keys: eslint- - - name: setup lerna cache - id: lerna-cache - uses: actions/cache@v3 - with: - path: | - node_modules/.cache - key: lerna-cache-${{matrix.task}}-${{github.sha}} - restore-keys: | - lerna-cache-${{matrix.task}} - - name: install dependencies run: pnpm install - - name: Run ${{ matrix.task }} - run: npm run ${{ matrix.task }} - - release: - if: - ${{ github.ref_name == 'main' && github.actor != 'support-empathy' && - !startsWith(github.event.head_commit.message, 'chore(release):') }} - needs: [build] - runs-on: ubuntu-latest - container: - image: cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1 - # https://github.com/cypress-io/github-action#firefox Cypress FF image needs this user permissions to be able to install dependencies - options: --user 1001 - - steps: - - name: checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - persist-credentials: false - # Install pnpm because it is not included in our container image - - name: install pnpm - uses: pnpm/action-setup@v2 - with: - version: 7 + - name: lint packages + run: pnpm run lint - - name: setup ENV variables - id: setup-env-vars - shell: bash - run: | - echo "CYPRESS_CACHE_FOLDER=$CYPRESS_CACHE_FOLDER" >> $GITHUB_OUTPUT - echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - name: setup pnpm cache - id: pnpm-cache - uses: actions/cache@v3 - with: - path: | - ${{ steps.setup-env-vars.outputs.PNPM_STORE_PATH }} - ${{ steps.setup-env-vars.outputs.CYPRESS_CACHE_FOLDER }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: setup lerna cache - id: lerna-cache - uses: actions/cache@v3 - with: - key: lerna-cache-${{github.sha}} - path: | - node_modules/.cache - restore-keys: | - lerna-cache- - - - name: install dependencies - run: pnpm install + - name: test packages + run: pnpm run test - - name: Release alpha on non-release pushes to main branch + - name: release alpha on non-release pushes to main branch + if: + ${{ github.ref_name == 'main' && github.actor != 'support-empathy' && + !startsWith(github.event.head_commit.message, 'chore(release):') }} uses: ./.github/actions/release-alpha with: npm_token: ${{ secrets.NPM_TOKEN }} diff --git a/nx.json b/nx.json index 8084bd7475..977666b1f9 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "test:unit", "test:unit-cypress"] + "cacheableOperations": ["build", "test"] } } }, diff --git a/package.json b/package.json index 1ca0f9e4a4..d5157f8670 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,7 @@ "build": "lerna run build", "lint": "lerna run lint -- --quiet --cache --cache-strategy content", "lint:fix": "lerna run lint -- --fix", - "test:e2e:ci": "lerna run test:e2e:ci", - "test:unit": "lerna run test:unit", - "test:unit-cypress": "lerna run test:unit-cypress", + "test": "echo RESTORE TESTS", "serve": "lerna run serve", "prepare-release:stable": "lerna version --conventional-commits --conventional-graduate --no-git-tag-version --yes", "release:alpha": "lerna publish --conventional-commits --conventional-prerelease --yes --no-push", diff --git a/packages/deep-merge/package.json b/packages/deep-merge/package.json index e792b8b386..e6cc85114b 100644 --- a/packages/deep-merge/package.json +++ b/packages/deep-merge/package.json @@ -34,7 +34,7 @@ "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", "prepublishOnly": "pnpm run build", - "test:unit": "jest" + "test": "jest" }, "dependencies": { "@empathyco/x-utils": "^1.0.0-alpha.19", diff --git a/packages/jest-utils/CHANGELOG.md b/packages/jest-utils/CHANGELOG.md index 5d4d31173d..6e4f841e2d 100644 --- a/packages/jest-utils/CHANGELOG.md +++ b/packages/jest-utils/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.0-alpha.1](https://github.com/empathyco/x/compare/@empathyco/x-jest-utils@2.0.0-alpha.1...@empathyco/x-jest-utils@2.0.0-alpha.1) (2023-05-11) + +**Note:** Version bump only for package @empathyco/x-jest-utils + + +# Change Log + +All notable changes to this project will be documented in this file. See +[Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ## [2.0.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/x-jest-utils@2.0.0-alpha.0...@empathyco/x-jest-utils@2.0.0-alpha.0) (2023-05-09) **Note:** Version bump only for package @empathyco/x-jest-utils diff --git a/packages/jest-utils/package.json b/packages/jest-utils/package.json index c921a43cda..9507ad09ce 100644 --- a/packages/jest-utils/package.json +++ b/packages/jest-utils/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-jest-utils", - "version": "2.0.0-alpha.0", + "version": "2.0.0-alpha.1", "description": "Jest extensions for easier testing", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index c1b64feda9..c3086d1a95 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.0-alpha.1](https://github.com/empathyco/x/compare/@empathyco/x-logger@2.0.0-alpha.1...@empathyco/x-logger@2.0.0-alpha.1) (2023-05-11) + +**Note:** Version bump only for package @empathyco/x-logger + +# Change Log + +All notable changes to this project will be documented in this file. See +[Conventional Commits](https://conventionalcommits.org) for commit guidelines. + ## [2.0.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/x-logger@2.0.0-alpha.0...@empathyco/x-logger@2.0.0-alpha.0) (2023-05-09) **Note:** Version bump only for package @empathyco/x-logger diff --git a/packages/logger/package.json b/packages/logger/package.json index 577447f562..28dc6e1ba5 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-logger", - "version": "2.0.0-alpha.0", + "version": "2.0.0-alpha.1", "description": "Empathy simple logger", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", @@ -31,7 +31,7 @@ "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", "prepublishOnly": "pnpm run build", - "test:unit": "jest" + "test": "jest" }, "dependencies": { "tslib": "~2.5.0" diff --git a/packages/storage-service/package.json b/packages/storage-service/package.json index d145a384f9..6441471240 100644 --- a/packages/storage-service/package.json +++ b/packages/storage-service/package.json @@ -33,7 +33,7 @@ "build:watch": "tsc --watch", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", "prepublishOnly": "pnpm run build" diff --git a/packages/x-adapter-platform/package.json b/packages/x-adapter-platform/package.json index 20d372e4fe..c3abd07db3 100644 --- a/packages/x-adapter-platform/package.json +++ b/packages/x-adapter-platform/package.json @@ -36,7 +36,7 @@ "gen:typescript-docs": "api-documenter markdown -i report -o docs", "gen:docs": "pnpm run gen:model-docs && pnpm run gen:typescript-docs", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "prepublishOnly": "pnpm run build" }, "dependencies": { diff --git a/packages/x-adapter/package.json b/packages/x-adapter/package.json index bcdf06e037..f25ac6405e 100644 --- a/packages/x-adapter/package.json +++ b/packages/x-adapter/package.json @@ -32,7 +32,7 @@ "build:esm": "tsc --project tsconfig.esm.json", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "prepublishOnly": "pnpm run build" }, "dependencies": { diff --git a/packages/x-archetype-utils/package.json b/packages/x-archetype-utils/package.json index d885aceeb0..8e2d444f3d 100644 --- a/packages/x-archetype-utils/package.json +++ b/packages/x-archetype-utils/package.json @@ -31,7 +31,7 @@ "build:esm": "tsc --project tsconfig.esm.json", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "prepublishOnly": "pnpm run build" }, "dependencies": { diff --git a/packages/x-bus/package.json b/packages/x-bus/package.json index 123a0aa3e5..c25ebd0c47 100644 --- a/packages/x-bus/package.json +++ b/packages/x-bus/package.json @@ -31,7 +31,7 @@ "build:esm": "tsc --project tsconfig.esm.json", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "prepublishOnly": "pnpm run build" }, "bugs": { diff --git a/packages/x-priority-queue/package.json b/packages/x-priority-queue/package.json index c4abfab7bd..ead22b6d10 100644 --- a/packages/x-priority-queue/package.json +++ b/packages/x-priority-queue/package.json @@ -31,7 +31,7 @@ "build:esm": "tsc --project tsconfig.esm.json", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest", + "test": "jest", "prepublishOnly": "pnpm run build" }, "dependencies": { diff --git a/packages/x-svg-converter/package.json b/packages/x-svg-converter/package.json index e8b31c24cf..9f1c991f2a 100644 --- a/packages/x-svg-converter/package.json +++ b/packages/x-svg-converter/package.json @@ -28,7 +28,7 @@ "build": "tsc --project tsconfig.build.json", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest -i" + "test": "jest -i" }, "devDependencies": { "@types/jest": "~27.5.0", diff --git a/packages/x-translations/package.json b/packages/x-translations/package.json index 646cfd833d..5ae9dedb99 100644 --- a/packages/x-translations/package.json +++ b/packages/x-translations/package.json @@ -27,7 +27,7 @@ "build": "tsc", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", - "test:unit": "jest -i" + "test": "jest -i" }, "dependencies": { "@empathyco/x-deep-merge": "^1.3.0-alpha.34" diff --git a/packages/x-utils/package.json b/packages/x-utils/package.json index b07ba4e656..285713b481 100644 --- a/packages/x-utils/package.json +++ b/packages/x-utils/package.json @@ -27,7 +27,7 @@ "scripts": { "prebuild": "rimraf ./dist ./types", "build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json", - "test:unit": "jest", + "test": "jest", "postbuild": "pnpm pack", "lint": "eslint . --ext .ts", "prepublishOnly": "pnpm run build"