chore(github-actions): separate frontend and backend tests (#2013)

This commit is contained in:
ChengLei Shao 2023-06-09 09:23:04 +08:00 committed by GitHub
parent 9c165db0f7
commit f1cc991c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 112 deletions

View File

@ -0,0 +1,34 @@
name: Nocobase Build Test
on:
push:
branches:
- 'main'
- 'develop'
paths:
- '.github/workflows/nocobase-build-test.yml'
- 'packages/**'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/nocobase-build-test.yml'
- 'packages/**'
jobs:
build-test:
strategy:
matrix:
node_version: [ '18' ]
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- run: yarn install
- run: yarn build
timeout-minutes: 15

View File

@ -1,4 +1,4 @@
name: NocoBase Test Full name: NocoBase Backend Test
on: on:
push: push:
@ -11,6 +11,7 @@ on:
- 'packages/core/database/**' - 'packages/core/database/**'
- 'packages/core/server/**' - 'packages/core/server/**'
- 'packages/plugins/**/src/server/**' - 'packages/plugins/**/src/server/**'
- '.github/workflows/nocobase-test-backend.yml'
pull_request: pull_request:
paths: paths:
- 'packages/core/acl/**' - 'packages/core/acl/**'
@ -18,30 +19,14 @@ on:
- 'packages/core/database/**' - 'packages/core/database/**'
- 'packages/core/server/**' - 'packages/core/server/**'
- 'packages/plugins/**/src/server/**' - 'packages/plugins/**/src/server/**'
- '.github/workflows/nocobase-test-backend.yml'
jobs: jobs:
build-test:
strategy:
matrix:
node_version: ['18']
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- run: yarn install
- run: yarn build
timeout-minutes: 15
sqlite-test: sqlite-test:
strategy: strategy:
matrix: matrix:
node_version: ['18'] node_version: [ '18' ]
underscored: [true, false] underscored: [ true, false ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
steps: steps:
@ -53,7 +38,7 @@ jobs:
cache: 'yarn' cache: 'yarn'
- run: yarn install - run: yarn install
- name: Test with Sqlite - name: Test with Sqlite
run: yarn nocobase install -f && yarn test && yarn test:client run: yarn nocobase install -f && yarn test
env: env:
DB_DIALECT: sqlite DB_DIALECT: sqlite
DB_STORAGE: /tmp/db.sqlite DB_STORAGE: /tmp/db.sqlite
@ -63,10 +48,10 @@ jobs:
postgres-test: postgres-test:
strategy: strategy:
matrix: matrix:
node_version: ['18'] node_version: [ '18' ]
underscored: [true, false] underscored: [ true, false ]
schema: [public, nocobase] schema: [ public, nocobase ]
collection_schema: [public, user_schema] collection_schema: [ public, user_schema ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
services: services:
@ -94,7 +79,7 @@ jobs:
- run: yarn install - run: yarn install
# - run: yarn build # - run: yarn build
- name: Test with postgres - name: Test with postgres
run: yarn nocobase install -f && yarn test && yarn test:client run: yarn nocobase install -f && yarn test
env: env:
DB_DIALECT: postgres DB_DIALECT: postgres
DB_HOST: postgres DB_HOST: postgres
@ -110,8 +95,8 @@ jobs:
mysql-test: mysql-test:
strategy: strategy:
matrix: matrix:
node_version: ['18'] node_version: [ '18' ]
underscored: [true, false] underscored: [ true, false ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
services: services:
@ -131,7 +116,7 @@ jobs:
- run: yarn install - run: yarn install
# - run: yarn build # - run: yarn build
- name: Test with MySQL - name: Test with MySQL
run: yarn nocobase install -f && yarn test && yarn test:client run: yarn nocobase install -f && yarn test
env: env:
DB_DIALECT: mysql DB_DIALECT: mysql
DB_HOST: mysql DB_HOST: mysql

View File

@ -0,0 +1,42 @@
name: NocoBase FrontEnd Test
on:
push:
branches:
- main
- develop
paths:
- 'packages/**'
- '.github/workflows/nocobase-test-frontend.yml'
- '!packages/core/acl/**'
- '!packages/core/actions/**'
- '!packages/core/database/**'
- '!packages/core/server/**'
- '!packages/plugins/**/src/server/**'
pull_request:
paths:
- '.github/workflows/nocobase-test-frontend.yml'
- 'packages/**'
- '!packages/core/acl/**'
- '!packages/core/actions/**'
- '!packages/core/database/**'
- '!packages/core/server/**'
- '!packages/plugins/**/src/server/**'
jobs:
frontend-test:
strategy:
matrix:
node_version: [ '18' ]
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- run: yarn install
- run: yarn test:client
timeout-minutes: 15

View File

@ -1,83 +0,0 @@
name: NocoBase Test Lite
on:
push:
branches:
- main
- develop
paths:
- 'packages/**'
- '!packages/core/acl/**'
- '!packages/core/actions/**'
- '!packages/core/database/**'
- '!packages/core/server/**'
- '!packages/plugins/**/src/server/**'
pull_request:
paths:
- 'packages/**'
- '!packages/core/acl/**'
- '!packages/core/actions/**'
- '!packages/core/database/**'
- '!packages/core/server/**'
- '!packages/plugins/**/src/server/**'
jobs:
build-test:
strategy:
matrix:
node_version: ['18']
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- run: yarn install
- run: yarn build
timeout-minutes: 15
postgres-test:
strategy:
matrix:
node_version: ['18']
runs-on: ubuntu-latest
container: node:${{ matrix.node_version }}
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:10
# Provide the password for postgres
env:
POSTGRES_USER: nocobase
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- run: yarn install
- name: Test with postgres
run: yarn nocobase install -f && yarn test && yarn test:client
env:
DB_DIALECT: postgres
DB_HOST: postgres
DB_PORT: 5432
DB_USER: nocobase
DB_PASSWORD: password
DB_DATABASE: nocobase
DB_UNDERSCORED: true
DB_SCHEMA: nocobase
COLLECTION_MANAGER_SCHEMA: user_schema
timeout-minutes: 30