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
19 changes: 13 additions & 6 deletions action/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61529,10 +61529,15 @@ async function uploadLocalDirectory(localDir, bucketName, s3Prefix) {
nodir: true,
absolute: false
});
const filesFromFailingTests = files.filter(
(file) => files.some(
(other) => path5.dirname(other) === path5.dirname(file) && path5.basename(other) === "new.png"
)
);
info(
`Uploading ${files.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
`Uploading ${filesFromFailingTests.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
);
await (0, import_bluebird.map)(files, async (file) => {
await (0, import_bluebird.map)(filesFromFailingTests, async (file) => {
const localFilePath = path5.join(localDir, file);
const s3Key = path5.join(s3Prefix, file);
const fileContent = await import_fs5.promises.readFile(localFilePath);
Expand All @@ -61543,9 +61548,12 @@ async function uploadLocalDirectory(localDir, bucketName, s3Prefix) {
});
await s3Client.send(command);
});
info(`Uploaded ${files.length} file(s) to s3://${bucketName}/${s3Prefix}`);
info(
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
);
}
async function uploadSingleFile(localFilePath, bucketName, s3Key) {
async function uploadSingleFile(localFilePath, s3Key) {
const bucketName = getInput("bucket-name", { required: true });
const fileContent = await import_fs5.promises.readFile(localFilePath);
const command = new PutObjectCommand({
Bucket: bucketName,
Expand Down Expand Up @@ -61608,11 +61616,10 @@ var uploadAllImages = async (hash) => {
);
};
var uploadBaseImages = async (newFilePaths) => {
const bucketName = getInput("bucket-name", { required: true });
info(`Uploading ${newFilePaths.length} base image(s)`);
return (0, import_bluebird.map)(
newFilePaths,
(newFilePath) => uploadSingleFile(newFilePath, bucketName, buildBaseImagePath(newFilePath))
(newFilePath) => uploadSingleFile(newFilePath, buildBaseImagePath(newFilePath))
);
};
function buildBaseImagePath(newFilePath) {
Expand Down
2 changes: 1 addition & 1 deletion action/dist/main.js.map

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions action/src/s3-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,19 @@ async function uploadLocalDirectory(
absolute: false
});

const filesFromFailingTests = files.filter(file =>
files.some(
other =>
path.dirname(other) === path.dirname(file) &&
path.basename(other) === 'new.png'
)
);

info(
`Uploading ${files.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
`Uploading ${filesFromFailingTests.length} file(s) from ${localDir} to s3://${bucketName}/${s3Prefix}`
);

await map(files, async file => {
await map(filesFromFailingTests, async file => {
const localFilePath = path.join(localDir, file);
const s3Key = path.join(s3Prefix, file);

Expand All @@ -110,16 +118,17 @@ async function uploadLocalDirectory(
await s3Client.send(command);
});

info(`Uploaded ${files.length} file(s) to s3://${bucketName}/${s3Prefix}`);
info(
`Uploaded ${filesFromFailingTests.length} file(s) to s3://${bucketName}/${s3Prefix}`
);
}

async function uploadSingleFile(
localFilePath: string,
bucketName: string,
s3Key: string
): Promise<void> {
const bucketName = getInput('bucket-name', { required: true });
const fileContent = await fsPromises.readFile(localFilePath);

const command = new PutObjectCommand({
Bucket: bucketName,
Key: s3Key,
Expand Down Expand Up @@ -190,10 +199,9 @@ export const uploadAllImages = async (hash: string) => {
};

export const uploadBaseImages = async (newFilePaths: string[]) => {
const bucketName = getInput('bucket-name', { required: true });
info(`Uploading ${newFilePaths.length} base image(s)`);
return map(newFilePaths, newFilePath =>
uploadSingleFile(newFilePath, bucketName, buildBaseImagePath(newFilePath))
uploadSingleFile(newFilePath, buildBaseImagePath(newFilePath))
);
};

Expand Down
Loading