Release tracking #4054
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UI test | |
on: | |
pull_request: | |
jobs: | |
test: | |
if: ${{ github.repository == 'primer/brand' }} | |
name: Primitives diff | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Checkout reference branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
path: temp-main | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies (reference) | |
run: pushd temp-main; npm ci --legacy-peer-deps; popd | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- name: Build (reference) | |
run: pushd temp-main; npm run build --workspace=packages/design-tokens; popd | |
- name: Build | |
run: npm run build --workspace=packages/design-tokens | |
- name: Export diff | |
run: | | |
diff -r -y --width=300 -B -I 'Generated' --suppress-common-lines temp-main/packages/design-tokens/lib/design-tokens/css packages/design-tokens/lib/design-tokens/css | tail -n +2 > diff.txt | |
npx ts-node ./packages/design-tokens/scripts/ci-check-diff.ts | |
- name: Read raw diff | |
if: hashFiles('diff.md') != '' | |
id: diff | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: ./diff.md | |
- name: Post diff | |
if: hashFiles('diff.md') != '' | |
uses: phulsechinmay/[email protected] | |
with: | |
message: ${{ steps.diff.outputs.content }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMMENT_IDENTIFIER: 'primitives-diff' | |
- name: Comment on the PR about no results | |
if: hashFiles('diff.md') == '' | |
uses: phulsechinmay/[email protected] | |
with: | |
message: | | |
### 🟢 No design token changes found | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMMENT_IDENTIFIER: 'primitives-diff' |