-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d2ae27
commit 0b39741
Showing
3 changed files
with
51 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,14 @@ name: Node.js CI | |
|
||
on: | ||
push: | ||
branches: [v4-next] | ||
branches: [main] | ||
paths-ignore: | ||
- .github/workflows/site.yml | ||
- 'site/**' | ||
- '*.md' | ||
pull_request: | ||
paths-ignore: | ||
- .github/workflows/site.yml | ||
- 'site/**' | ||
- '*.md' | ||
|
||
|
@@ -16,7 +18,7 @@ jobs: | |
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
node-version: [18] | ||
node-version: [16, 18, 'lts/*'] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
services: | ||
|
@@ -60,16 +62,16 @@ jobs: | |
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | ||
KAFKA_ADVERTISED_PORT: 9092 | ||
|
||
# postgres: | ||
# image: postgres:alpine | ||
# ports: | ||
# - 5432:5432 | ||
# env: | ||
# POSTGRES_DB: db_ci_test | ||
# POSTGRES_USER: postgres | ||
# POSTGRES_PASSWORD: postgres | ||
# # needed because the postgres container does not provide a healthcheck | ||
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
# postgres: | ||
# image: postgres:alpine | ||
# ports: | ||
# - 5432:5432 | ||
# env: | ||
# POSTGRES_DB: db_ci_test | ||
# POSTGRES_USER: postgres | ||
# POSTGRES_PASSWORD: postgres | ||
# # needed because the postgres container does not provide a healthcheck | ||
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
etcd: | ||
image: bitnami/etcd | ||
|
@@ -84,42 +86,20 @@ jobs: | |
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: 4.2 | ||
|
||
- name: Start Mosquitto | ||
uses: namoshek/mosquitto-github-action@v1 | ||
with: | ||
version: 'latest' | ||
ports: '1883:1883 8883:8883' | ||
config: ${{ github.workspace }}/packages/mqtt/scripts/mosquitto.conf | ||
container-name: 'mqtt' | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Install codecov | ||
run: pnpm add -g codecov | ||
|
||
- name: Build | ||
run: pnpm run build --if-present | ||
|
||
- name: Run tests and coverage | ||
run: pnpm run cov | ||
- run: npm run install_npm | ||
- run: npm install && npm install codecov | ||
- run: npm run build --if-present | ||
- run: npm run cov | ||
env: | ||
RABBITMQ_URL: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }} | ||
ALI_SDK_OSS_REGION: ${{ secrets.ALI_SDK_OSS_REGION }} | ||
|
@@ -131,7 +111,6 @@ jobs: | |
ALI_SDK_STS_SECRET: ${{ secrets.ALI_SDK_STS_SECRET }} | ||
ALI_SDK_STS_BUCKET: ${{ secrets.ALI_SDK_STS_BUCKET }} | ||
ALI_SDK_STS_ROLE: ${{ secrets.ALI_SDK_STS_ROLE }} | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: [main] | ||
paths: | ||
- .github/workflows/site.yml | ||
- site/** | ||
- CHANGELOG.md | ||
# repository_dispatch: | ||
|
@@ -24,13 +25,28 @@ jobs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm run build --if-present | ||
- name: action-zip | ||
uses: montudor/[email protected] | ||
|
||
# 安装根目录依赖 | ||
- name: Install root dependencies | ||
run: npm install | ||
|
||
# 构建根目录项目 | ||
- name: Build root project | ||
run: npm run build --if-present | ||
|
||
# 安装和构建 site 目录 | ||
- name: Install and build site | ||
working-directory: site | ||
run: | | ||
npm install | ||
npm run build | ||
# 打包文档 | ||
- name: Zip output | ||
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars | ||
working-directory: site | ||
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars | ||
- name: upload files to OSS | ||
uses: fangbinwei/aliyun-oss-website-action@v1 | ||
with: | ||
|