Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Iru89 committed Mar 4, 2024
1 parent 3e4acc6 commit 28d6e5d
Show file tree
Hide file tree
Showing 32 changed files with 9,542 additions and 12,186 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/botonic-ci-test-all-packages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Botonic test all packages
name: Botonic CI test all packages

on:
workflow_dispatch:
Expand Down Expand Up @@ -49,6 +49,7 @@ jobs:
PACKAGE_NAME: Botonic plugin-dialogflow tests
PACKAGE: botonic-plugin-dialogflow
UNIT_TEST_COMMAND: npm run test_ci
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
PUBLISH_TESTS_RESULTS: 'yes'
NEEDS_CODECOV_UPLOAD: 'yes'

Expand All @@ -68,7 +69,7 @@ jobs:
with:
PACKAGE_NAME: Botonic plugin-google-analytics tests
PACKAGE: botonic-plugin-google-analytics
BUILD_COMMAND: ''
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
UNIT_TEST_COMMAND: ''

botonic-plugin-inbenta-tests:
Expand Down Expand Up @@ -113,4 +114,5 @@ jobs:
with:
PACKAGE_NAME: Botonic react tests
PACKAGE: botonic-react
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
NEEDS_CODECOV_UPLOAD: 'yes'
24 changes: 16 additions & 8 deletions .github/workflows/botonic-common-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,26 @@ on:
type: string
description: 'Flag to know if the tests need some contentful secrets'
required: false
NEEDS_BOTONIC_CORE:
type: string
description: 'Flag to know if the package needs to build @botonic/core'
required: false

jobs:
bot-tests:
botonic-tests:
name: ${{ inputs.PACKAGE_NAME }} tests
runs-on: ubuntu-latest
steps:
- name: Checking out to current branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setting up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.NODE_VERSION }}

- name: Setting up cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -75,13 +79,17 @@ jobs:
role-duration-seconds: 900
role-session-name: HubtypeCITests

- name: Install dev dependencies
run: (cd ./packages/${{ inputs.PACKAGE }} && npm install -D)
- name: Install dependencies
run: npm install

- name: Build
if: ${{ inputs.BUILD_COMMAND != '' }}
if: ${{ inputs.BUILD_COMMAND != '' }} && ${{ inputs.NEEDS_BOTONIC_CORE == '' }}
run: (cd ./packages/${{ inputs.PACKAGE }} && ${{ inputs.BUILD_COMMAND }})

# - name: Build with botonic core
# if: ${{ inputs.NEEDS_BOTONIC_CORE != '' && always() }}
# run: (cd ./packages/botonic-core && ${{ inputs.BUILD_COMMAND }} && cd ../${{ inputs.PACKAGE }} && ${{ inputs.BUILD_COMMAND }})

- name: Run tests
if: ${{ inputs.UNIT_TEST_COMMAND != '' && always() && inputs.NEEDS_CONTENTFUL_SECRETS == '' }}
run: (cd ./packages/${{ inputs.PACKAGE }} && ${{ inputs.UNIT_TEST_COMMAND }})
Expand All @@ -95,7 +103,7 @@ jobs:
CONTENTFUL_TEST_MANAGE_TOKEN: ${{ secrets.CONTENTFUL_TEST_MANAGE_TOKEN }}

- name: Verify lint
run: (cd ./packages/${{ inputs.PACKAGE }} && npm run lint_ci)
run: (cd ./packages/${{ inputs.PACKAGE }} && npm run lint_core)

- name: Publish Unit Test Results
if: ${{ inputs.PUBLISH_TESTS_RESULTS != '' && always() }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/botonic-plugin-dialogflow-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
with:
PACKAGE_NAME: Botonic plugin-dialogflow tests
PACKAGE: botonic-plugin-dialogflow
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
UNIT_TEST_COMMAND: npm run test_ci
PUBLISH_TESTS_RESULTS: 'yes'
NEEDS_CODECOV_UPLOAD: 'yes'
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
with:
PACKAGE_NAME: Botonic plugin-google-analytics tests
PACKAGE: botonic-plugin-google-analytics
BUILD_COMMAND: ''
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
UNIT_TEST_COMMAND: ''
1 change: 1 addition & 0 deletions .github/workflows/botonic-react-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
with:
PACKAGE_NAME: Botonic react tests
PACKAGE: botonic-react
BUILD_COMMAND: 'npm run build && cd ../botonic-core && npm run build'
NEEDS_CODECOV_UPLOAD: 'yes'
18 changes: 0 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ repos:
language: system
files: ^packages/botonic-core/

- id: core-d-ts
name: core-d-ts
entry: scripts/qa/old/lint-d-ts.sh packages/botonic-core
language: system
files: ^packages/botonic-core/src/.*\.d\.ts

- id: contentful
name: contentful
entry: scripts/qa/old/lint-package.sh packages/botonic-plugin-contentful
Expand Down Expand Up @@ -81,12 +75,6 @@ repos:
language: system
files: ^packages/botonic-react/

- id: react-d-ts
name: react-d-ts
entry: scripts/qa/old/lint-d-ts.sh packages/botonic-react
language: system
files: ^packages/botonic-react/src/.*\.d\.ts

- id: google-analytics
name: google-analytics
entry: scripts/qa/old/lint-package.sh packages/botonic-plugin-google-analytics
Expand All @@ -105,12 +93,6 @@ repos:
language: system
files: ^docs/

- id: plugin-intent-classification
name: plugin-intent-classification
entry: scripts/qa/old/lint-package.sh packages/botonic-plugin-intent-classification
language: system
files: ^packages/botonic-plugin-intent-classification/

- id: plugin-flow-builder
name: plugin-flow-builder
entry: scripts/qa/old/lint-package.sh packages/botonic-plugin-flow-builder
Expand Down
Loading

0 comments on commit 28d6e5d

Please sign in to comment.