ci(i18n): DLT-2451 setup i18n workflows #4559
Workflow file for this run
This file contains hidden or 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: Visual Tests | |
| on: | |
| push: | |
| branches: [ staging ] | |
| pull_request: | |
| types: [ unlabeled, labeled, synchronize, opened ] | |
| env: | |
| HUSKY: 0 | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| filter-actions: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| dialtone-vue-2: ${{ steps.filter.outputs.dialtone-vue-2 }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Filter actions by path | |
| if: github.event_name == 'pull_request' | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| dialtone-vue-2: | |
| - 'packages/dialtone-css/**' | |
| - 'packages/dialtone-icons/**' | |
| - 'packages/dialtone-tokens/**' | |
| - 'packages/dialtone-vue2/**' | |
| prompt-for-label: | |
| needs: filter-actions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Add label prompt message | |
| uses: mshick/add-pr-comment@v2 | |
| if: ${{ github.event_name == 'pull_request' && needs.filter-actions.outputs.dialtone-vue-2 == 'true' && (!contains(github.event.pull_request.labels.*.name, 'visual-test-ready') && !contains(github.event.pull_request.labels.*.name, 'no-visual-test')) }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| message: | | |
| Please add either the `visual-test-ready` or `no-visual-test` label to this PR depending on whether you want to run visual tests or not. | |
| It is recommended to run visual tests if your PR changes any UI. ‼️ | |
| message-id: 'missing-visual-test-label' | |
| refresh-message-position: true | |
| dialtone-vue-2: | |
| needs: filter-actions | |
| if: ${{ github.event_name == 'push' || (needs.filter-actions.outputs.dialtone-vue-2 == 'true' && contains(github.event.pull_request.labels.*.name, 'visual-test-ready')) }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: read | |
| steps: | |
| - name: Check out branch | |
| uses: actions/checkout@v4 | |
| - name: Use pnpm | |
| uses: pnpm/action-setup@v3 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "dialpad" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ github.token }} | |
| - name: Install dependencies | |
| shell: bash | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Dialtone-vue 2 Visual Tests | |
| env: | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| PERCY_TARGET_BRANCH: ${{ github.base_ref }} | |
| run: pnpm nx run --verbose dialtone-vue2:test:visual |