Skip to content

Commit

Permalink
ci: restore build workflow (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajperezbau authored May 11, 2023
1 parent cb86519 commit 076ee49
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 89 deletions.
81 changes: 9 additions & 72 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
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 }}
cancel-in-progress: true
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
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test:unit", "test:unit-cypress"]
"cacheableOperations": ["build", "test"]
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/deep-merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions packages/jest-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (2023-05-09)

**Note:** Version bump only for package @empathyco/x-jest-utils
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-utils/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 9 additions & 0 deletions packages/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (2023-05-09)

**Note:** Version bump only for package @empathyco/x-logger
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/storage-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/x-adapter-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-archetype-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-priority-queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-svg-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-translations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/x-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 076ee49

Please sign in to comment.