mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
ci: hardcode bucket for visual-diff (#46376)
This commit is contained in:
parent
2d28495c9c
commit
7eb91d9eec
@ -87,8 +87,6 @@ jobs:
|
||||
# Execute visual regression diff task and zip then
|
||||
# output as visualRegressionReport.tar.gz
|
||||
- name: visual regression diff
|
||||
env:
|
||||
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
|
||||
run: |
|
||||
npm run visual-regression -- --pr-id=${{ github.event.number }}
|
||||
|
||||
|
@ -88,7 +88,6 @@ jobs:
|
||||
env:
|
||||
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
|
||||
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}
|
||||
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
|
||||
run: |
|
||||
mkdir ./visualRegressionReport
|
||||
tar -xzvf visualRegressionReport.tar.gz -C ./visualRegressionReport
|
||||
|
@ -87,7 +87,6 @@ jobs:
|
||||
env:
|
||||
ALI_OSS_AK_ID: ${{ secrets.ALI_OSS_AK_ID }}
|
||||
ALI_OSS_AK_SECRET: ${{ secrets.ALI_OSS_AK_SECRET }}
|
||||
ALI_OSS_BUCKET: ${{ secrets.ALI_OSS_BUCKET }}
|
||||
run: |
|
||||
rm package.json
|
||||
npm i ali-oss --no-save
|
||||
|
@ -17,6 +17,8 @@ if (args.length < 2) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const ALI_OSS_BUCKET = 'antd-visual-diff';
|
||||
|
||||
/**
|
||||
* Extract the tar file path and ref value from the cli arguments
|
||||
* @param {string[]} cliArgs
|
||||
@ -99,7 +101,7 @@ async function boot() {
|
||||
endpoint: 'oss-cn-shanghai.aliyuncs.com',
|
||||
accessKeyId: process.env.ALI_OSS_AK_ID,
|
||||
accessKeySecret: process.env.ALI_OSS_AK_SECRET,
|
||||
bucket: process.env.ALI_OSS_BUCKET,
|
||||
bucket: ALI_OSS_BUCKET,
|
||||
});
|
||||
|
||||
// if is a file then upload it directly
|
||||
|
@ -19,6 +19,8 @@ import { PNG } from 'pngjs';
|
||||
import sharp from 'sharp';
|
||||
import { assert } from 'console';
|
||||
|
||||
const ALI_OSS_BUCKET = 'antd-visual-diff';
|
||||
|
||||
const compareScreenshots = async (
|
||||
baseImgPath: string,
|
||||
currentImgPath: string,
|
||||
@ -66,7 +68,7 @@ const readPngs = (dir: string) => fs.readdirSync(dir).filter((n) => n.endsWith('
|
||||
|
||||
const prettyList = (list: string[]) => list.map((i) => ` * ${i}`).join('\n');
|
||||
|
||||
const ossDomain = `https://${process.env.ALI_OSS_BUCKET}.oss-cn-shanghai.aliyuncs.com`;
|
||||
const ossDomain = `https://${ALI_OSS_BUCKET}.oss-cn-shanghai.aliyuncs.com`;
|
||||
|
||||
async function downloadFile(url: string, destPath: string) {
|
||||
const response = await fetch(url);
|
||||
|
Loading…
Reference in New Issue
Block a user