Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CD

on:
push:
branches: [ r137-dev ]
branches: [r137-dev]

workflow_dispatch:

jobs:
Expand All @@ -12,20 +12,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
uses: actions/checkout@v4
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
node-version: 16
cache: 'npm'
- name: Install packages
run: npm ci

version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: 安装依赖
run: pnpm install
- name: Build
run: npm run build
run: pnpm run build

- name: Install deployment packages
run: npm ci
run: pnpm install
working-directory: deployment

- name: Deploy to OSS
Expand All @@ -38,27 +41,36 @@ jobs:

steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
node-version: 20

- name: Modify version
run: |
sed -i 's/"version" *: *"\(.*\)"/"version": "\1-'$(git rev-parse HEAD)'"/g' package.json

- name: Install packages
run: npm ci
- uses: actions/checkout@v4
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: 安装依赖
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Modify npm repository
run: |
echo "@oppentech:registry=http://npm.internal.oppenlab.com/repository/npm_private/" >> ~/.npmrc
echo "//npm.internal.oppenlab.com/repository/npm_private/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> ~/.npmrc

- name: Publish to npm
run: npm publish
run: pnpm publish
94 changes: 61 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,52 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Install packages
run: npm ci

node-version: 20
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: 安装依赖
run: pnpm install
- name: Build packages
run: pnpm run build
- name: === Linting ===
run: npm run lint
run: pnpm run lint

unit:
name: "Unit testing"
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
uses: actions/checkout@v4
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
node-version: 16
cache: 'npm'
version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: 安装依赖
run: pnpm install
- name: Install packages
run: |
npm ci
npm ci --prefix test
pnpm install
pnpm install --prefix test
- name: Build
run: npm run build

run: pnpm run build
- name: === Unit testing ===
run: npm run test-unit
run: pnpm run test-unit

e2e:
name: "E2E testing"
Expand All @@ -63,36 +77,50 @@ jobs:
FORCE_COLOR: 1
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
node-version: 20
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install packages
run: |
npm ci
npm ci --prefix test
sudo apt-get install xvfb
pnpm install
pnpm install --prefix test
sudo apt-get install -y xvfb
- name: Build
run: npm run build

run: pnpm run build
- name: === E2E testing ===
run: xvfb-run --auto-servernum npm run test-e2e
run: xvfb-run --auto-servernum pnpm run test-e2e

e2e-cov:
name: "Ready for release"
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Install packages
run: npm ci

node-version: 20
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: 使用 Nnode.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: 安装依赖
run: pnpm install
- name: === Ready for release ===
run: npm run test-e2e-cov
run: pnpm run test-e2e-cov
31 changes: 17 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ jobs:
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install packages
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Output version number
id: version
Expand All @@ -44,16 +45,17 @@ jobs:
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install packages
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Install deployment packages
run: npm ci
run: pnpm install
working-directory: deployment

- name: Deploy to OSS
Expand All @@ -73,18 +75,19 @@ jobs:
- name: Install node
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
node-version: 20
- name: Install pnpm
run: npm install -g pnpm
- name: Install packages
run: npm ci
run: pnpm install

- name: Build
run: npm run build
run: pnpm run build

- name: Modify npm repository
run: |
echo "@oppentech:registry=http://npm.internal.oppenlab.com/repository/npm_private/" >> ~/.npmrc
echo "//npm.internal.oppenlab.com/repository/npm_private/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> ~/.npmrc

- name: Publish to npm
run: npm publish
run: pnpm publish
Loading