Skip to content

Commit

Permalink
fix: test & ci on 2x branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Nov 15, 2024
1 parent 66e9d1b commit f6c8657
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 76 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/add-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Add Label

on:
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
add-label:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Determine label based on target branch
id: determine-label
run: |
echo "${{github.event_name}}"
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
else
echo "label=" >> $GITHUB_ENV
fi
- name: Add label to Pull Request
if: env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
31 changes: 3 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- next
- V3.0
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

Expand Down Expand Up @@ -80,30 +80,5 @@ jobs:
run: npm run build:site

- name: Build NutUI-React Taro H5 Demo
run: npm run build:taro:site

add-label:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Determine label based on target branch
id: determine-label
run: |
echo "${{github.event_name}}"
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
else
echo "label=" >> $GITHUB_ENV
fi
- name: Add label to Pull Request
if: env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
if: github.ref == 'refs/heads/next'
run: npm run build:taro:site
47 changes: 0 additions & 47 deletions src/packages/range/__test__/__snapshots__/range.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,55 +41,8 @@ exports[`range props test 1`] = `
</div>
`;

exports[`range props test 2`] = `
<div>
<div
class="nut-range-container test-range"
>
<div
class="min"
>
0
</div>
<div
class="nut-range"
>
<div
class="nut-range-bar"
style="width: 40%; left: 0%; transition: none;"
>
<div
class="nut-range-button-wrapper"
>
<div
class="nut-range-button"
>
<div
class="number"
>
40
</div>
</div>
</div>
</div>
</div>
<div
class="max"
>
100
</div>
</div>
</div>
`;

exports[`range test 1`] = `
"<div><div class="nut-range-container"><div class="min">0</div><div class="nut-range"><div class="nut-range-bar" style="width: 30%; left: 30%; transition: none;"><div class="nut-range-button-wrapper-left
"><div class="nut-range-button"><div class="number">30</div></div></div><div class="
nut-range-button-wrapper-right"><div class="nut-range-button"><div class="number">60</div></div></div></div></div><div class="max">100</div></div></div>"
`;

exports[`range test 2`] = `
"<div><div class="nut-range-container"><div class="min">0</div><div class="nut-range"><div class="nut-range-bar" style="width: 30%; left: 30%; transition: none;"><div class="nut-range-button-wrapper-left
"><div class="nut-range-button"><div class="number">30</div></div></div><div class="
nut-range-button-wrapper-right"><div class="nut-range-button"><div class="number">60</div></div></div></div></div><div class="max">100</div></div></div>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`textarea props test 1`] = `
<textarea
class="nut-textarea-textarea"
maxlength="20"
placeholder="请输入内容"
placeholder=""
rows="2"
>
基础用法
Expand Down

0 comments on commit f6c8657

Please sign in to comment.