Skip to content

Commit

Permalink
[HOLD] chore: reduce number of VRT combinations (#4923)
Browse files Browse the repository at this point in the history
* chore: reduce number of combinations

* chore: reduce number of combinations

* chore: update url comments builder

* chore: trigger vrts

* chore: add hcm link

* chore: fix hcm link

* chore: revert vrt trigger change
  • Loading branch information
rubencarvalho authored Nov 11, 2024
1 parent b359bc0 commit 6e3effc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ workflows:
name: << matrix.system >>-<< matrix.color >>-<< matrix.scale >>-<< matrix.dir >>
matrix:
parameters:
system: [spectrum, express]
color: [light, dark]
scale: [medium, large]
dir: [ltr, rtl]
system: [spectrum, express, spectrum-two]
color: [light]
scale: [medium]
dir: [ltr]
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
Expand All @@ -363,10 +363,10 @@ workflows:
name: << matrix.system >>-<< matrix.color >>-<< matrix.scale >>-<< matrix.dir >>
matrix:
parameters:
system: [spectrum-two]
color: [light, dark]
scale: [medium, large]
dir: [ltr, rtl]
system: [spectrum, express, spectrum-two]
color: [dark]
scale: [large]
dir: [rtl]
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
Expand Down
59 changes: 41 additions & 18 deletions tasks/build-preview-urls-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,51 @@ export const buildPreviewURLComment = (ref) => {
const branch = ref.replace('refs/heads/', '');
const branchSlug = slugify(branch);
const previewLinks = [];
const themes = ['Spectrum', 'Express', 'Spectrum-two'];
const scales = ['Medium', 'Large'];
const colors = ['Light', 'Dark'];
const directions = ['LTR', 'RTL'];

const combinations = [
{
system: 'Spectrum',
color: 'Light',
scale: 'Medium',
direction: 'LTR',
},
{ system: 'Spectrum', color: 'Dark', scale: 'Large', direction: 'RTL' },
{
system: 'Express',
color: 'Light',
scale: 'Medium',
direction: 'LTR',
},
{ system: 'Express', color: 'Dark', scale: 'Large', direction: 'RTL' },
{
system: 'Spectrum-two',
color: 'Light',
scale: 'Medium',
direction: 'LTR',
},
{
system: 'Spectrum-two',
color: 'Dark',
scale: 'Large',
direction: 'RTL',
},
];

combinations.forEach(({ system, color, scale, direction }) => {
const context = `${branch}-${system.toLowerCase()}-${color.toLowerCase()}-${scale.toLowerCase()}-${direction.toLowerCase()}`;
previewLinks.push(`
- [${system} | ${color} | ${scale} | ${direction}](https://${getHash(
context
)}--spectrum-web-components.netlify.app/review/)`);
});

previewLinks.push(
`- [High Contrast Mode | Medium | LTR](https://${getHash(
`
- [High Contrast Mode | Medium | LTR](https://${getHash(
`${branch}-hcm`
)}--spectrum-web-components.netlify.app/review/)`
);
themes.map((theme) =>
colors.map((color) => {
scales.map((scale) =>
directions.map((direction) => {
const context = `${branch}-${theme.toLocaleLowerCase()}-${color.toLocaleLowerCase()}-${scale.toLocaleLowerCase()}-${direction.toLocaleLowerCase()}`;
previewLinks.push(`
- [${theme} | ${color} | ${scale} | ${direction}](https://${getHash(
context
)}--spectrum-web-components.netlify.app/review/)`);
})
);
})
);

let comment = `## Branch preview
- [Documentation Site](https://${branchSlug}--spectrum-web-components.netlify.app/)
Expand Down

0 comments on commit 6e3effc

Please sign in to comment.