Skip to content

Commit c63e64c

Browse files
ci: improve chromatic configuration and enable nami package checks (#1904)
1 parent 53fb460 commit c63e64c

File tree

3 files changed

+108
-5
lines changed

3 files changed

+108
-5
lines changed

.github/settings.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,10 @@ branches:
8787
strict: false
8888
# Required. The list of status checks to require in order to merge into this branch
8989
checks:
90-
- context: block-fixup
90+
- context: Block fixup commits
9191
- context: Prepare
9292
- context: Unit tests
9393
- context: Process smoke e2e test reports
94-
- context: >
95-
Run Chromatic check: Core
96-
- context: >
97-
Run Chromatic check: Staking
9894
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
9995
enforce_admins:
10096
# Prevent merge commits from being pushed to matching branches

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,3 +612,93 @@ jobs:
612612
if: ${{ needs.if-staking-changed.outputs.requireChromaticCheck == 0 }}
613613
run: echo "Chromatic check for packages/staking not needed"
614614
exit 0
615+
616+
if-nami-changed:
617+
name: When nami changed
618+
if: ${{ github.event.pull_request.draft == false }}
619+
runs-on: ubuntu-22.04
620+
outputs:
621+
requireChromaticCheck: ${{ steps.diffcheck.outputs.requireChromaticCheck }}
622+
steps:
623+
- name: Checkout repository
624+
uses: actions/checkout@v4
625+
with:
626+
fetch-depth: 0
627+
628+
- id: diffcheck
629+
run: |
630+
set +e
631+
git diff --quiet ${{ github.event.pull_request.base.sha }}..${{ github.sha }} -- packages/nami/**
632+
echo "requireChromaticCheck=$?" >> "$GITHUB_OUTPUT"
633+
cat $GITHUB_OUTPUT
634+
set -e
635+
636+
chromaticNami:
637+
name: >
638+
Run Chromatic check: Nami
639+
runs-on: ubuntu-22.04
640+
needs:
641+
- prepare
642+
- if-nami-changed
643+
644+
steps:
645+
- name: Checkout repository
646+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
647+
uses: actions/checkout@v4
648+
with:
649+
fetch-depth: 0
650+
651+
- name: Setup Node.js and install dependencies
652+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
653+
uses: ./.github/actions/install
654+
with:
655+
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
656+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
657+
658+
- name: Download packages-common
659+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
660+
uses: actions/download-artifact@v4
661+
with:
662+
name: packages-common
663+
path: packages/common/dist
664+
665+
- name: Download packages-cardano
666+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
667+
uses: actions/download-artifact@v4
668+
with:
669+
name: packages-cardano
670+
path: packages/cardano/dist
671+
672+
- name: Download packages-translation
673+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
674+
uses: actions/download-artifact@v4
675+
with:
676+
name: packages-translation
677+
path: packages/translation/dist
678+
679+
- name: Download packages-core
680+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
681+
uses: actions/download-artifact@v4
682+
with:
683+
name: packages-core
684+
path: packages/core/dist
685+
686+
- name: Download packages-nami
687+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
688+
uses: actions/download-artifact@v4
689+
with:
690+
name: packages-nami
691+
path: packages/nami/dist
692+
693+
- name: Chromatic packages-nami
694+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 1 }}
695+
uses: ./.github/actions/chromatic
696+
with:
697+
DIR: packages/nami
698+
NAME: packages-nami
699+
TOKEN: ${{ secrets.CHROMATIC_LACE_NAMI_TOKEN }}
700+
701+
- name: Skip
702+
if: ${{ needs.if-nami-changed.outputs.requireChromaticCheck == 0 }}
703+
run: echo "Chromatic check for packages/nami not needed"
704+
exit 0

.github/workflows/git-checks.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Git Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
block-fixup:
9+
name: Block fixup commits
10+
if: github.event.pull_request.draft == false
11+
runs-on: ubuntu-22.04
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Block Fixup Commit Merge
17+
uses: 13rac1/block-fixup-merge-action@v2.0.0

0 commit comments

Comments
 (0)