Skip to content

Commit

Permalink
Merge branch 'main' into tirgger-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aojunhao123 authored Dec 31, 2024
2 parents 0c50db7 + 690cffd commit 3fa6208
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
35 changes: 5 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

name: ✅ test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- run: npm install
- run: npm run compile
- run: npm run lint
- run: npm run coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test:
uses: react-component/rc-test/.github/workflows/test.yml@main
secrets: inherit
34 changes: 34 additions & 0 deletions bench/presets.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ describe('presets', () => {
const magenta = presetPalettes.magenta;
const grey = presetPalettes.grey;
const gray = presetPalettes.grey;

expect(red).toBeTruthy();
expect(volcano).toBeTruthy();
expect(gold).toBeTruthy();
expect(orange).toBeTruthy();
expect(yellow).toBeTruthy();
expect(lime).toBeTruthy();
expect(green).toBeTruthy();
expect(cyan).toBeTruthy();
expect(blue).toBeTruthy();
expect(geekblue).toBeTruthy();
expect(purple).toBeTruthy();
expect(magenta).toBeTruthy();
expect(grey).toBeTruthy();
expect(gray).toBeTruthy();
});

bench('pre-compile', () => {
Expand Down Expand Up @@ -470,5 +485,24 @@ describe('presets', () => {
grey: greyDark,
gray: greyDark,
};

expect(red).toBeTruthy();
expect(volcano).toBeTruthy();
expect(gold).toBeTruthy();
expect(orange).toBeTruthy();
expect(yellow).toBeTruthy();
expect(lime).toBeTruthy();
expect(green).toBeTruthy();
expect(cyan).toBeTruthy();
expect(blue).toBeTruthy();
expect(geekblue).toBeTruthy();
expect(purple).toBeTruthy();
expect(magenta).toBeTruthy();
expect(grey).toBeTruthy();
expect(gray).toBeTruthy();
expect(presetPrimaryColors).toBeTruthy();
expect(presetPalettes).toBeTruthy();
expect(grayDark).toBeTruthy();
expect(presetDarkPalettes).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
],
"scripts": {
"bench": "vitest bench",
"compile": "father build",
"coverage": "npm test -- --coverage",
"compile": "father build",
"lint": "eslint src --ext .ts",
"prepare": "tsx generate-presets",
"prepublishOnly": "npm run compile && np --no-cleanup --no-publish",
Expand Down
2 changes: 1 addition & 1 deletion src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ColorInput } from '@ant-design/fast-color';
import type { ColorInput} from '@ant-design/fast-color';
import { FastColor } from '@ant-design/fast-color';

const hueStep = 2; // 色相阶梯
Expand Down

0 comments on commit 3fa6208

Please sign in to comment.