mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
ci: simplify workflows (#9737)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
name: 📮 Post lint commit message
|
||||
name: 📮 Lint Commit Message Post
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ['Lint commit message']
|
||||
workflows: ['Lint Commit Message']
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
22
.github/workflows/lint-commit-message.yml
vendored
22
.github/workflows/lint-commit-message.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Lint commit message
|
||||
name: Lint Commit Message
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -8,12 +8,6 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: ['16']
|
||||
include:
|
||||
- node-version: '16'
|
||||
node-name: 'Latest'
|
||||
outputs:
|
||||
failed: ${{ steps.lint_commit.outputs.failed == 'true' }}
|
||||
env:
|
||||
@@ -21,17 +15,14 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Add dev branch
|
||||
run: git branch dev origin/dev
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: 16
|
||||
|
||||
- name: Cache ~/.pnpm-store
|
||||
uses: actions/cache@v3
|
||||
@@ -47,25 +38,32 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile
|
||||
|
||||
- name: Lint commit
|
||||
id: lint_commit
|
||||
run: pnpm lint:commit || echo "::set-output name=failed::true"
|
||||
|
||||
- name: Set success result
|
||||
if: ${{ steps.lint_commit.outputs.failed != 'true' }}
|
||||
run: echo 'true' > ./lint-result.txt
|
||||
|
||||
- name: Set failed result
|
||||
if: ${{ steps.lint_commit.outputs.failed == 'true' }}
|
||||
run: echo 'false' > ./lint-result.txt
|
||||
|
||||
- name: Set PR number
|
||||
run: echo $PULL_REQUEST_NUMBER > pr.txt
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: commit-lint-report
|
||||
path: ./commit-lint.txt
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: commit-lint-result
|
||||
path: ./lint-result.txt
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: pr-number
|
||||
|
||||
15
.github/workflows/test-ssr.yml
vendored
15
.github/workflows/test-ssr.yml
vendored
@@ -1,19 +1,16 @@
|
||||
# This workflow runs on target, so there is no need to worry about secrets
|
||||
|
||||
name: 🧪 Test SSR
|
||||
|
||||
on: pull_request
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Build successfully, start deployment
|
||||
test:
|
||||
name: SSR rendering test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -26,7 +23,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: 16
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -37,5 +34,5 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
|
||||
- name: Do test
|
||||
- name: Test
|
||||
run: pnpm test:ssr
|
||||
|
||||
39
.github/workflows/test-unit.yml
vendored
39
.github/workflows/test-unit.yml
vendored
@@ -1,5 +1,3 @@
|
||||
# Unit Test
|
||||
|
||||
name: 🧪 Unit Test
|
||||
|
||||
on: pull_request
|
||||
@@ -9,15 +7,9 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Unit Test (${{ matrix.node-name }})
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: ['16']
|
||||
include:
|
||||
- node-version: '16'
|
||||
node-name: 'Latest'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -33,7 +25,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: 16
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -45,5 +37,30 @@ jobs:
|
||||
- name: Type Check
|
||||
run: pnpm typecheck
|
||||
|
||||
build:
|
||||
name: Unit Test (${{ matrix.node-name }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: ['16']
|
||||
include:
|
||||
- node-version: '16'
|
||||
node-name: 'Latest'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile
|
||||
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
|
||||
Reference in New Issue
Block a user