DeFiCh/wallet

View on GitHub
.github/workflows/ci-drift.yml

Summary

Maintainability
Test Coverage
name: CI Drift

on:
  pull_request:
    branches: [main]
    paths-ignore:
      - "**.md"

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  tailwind:
    name: Tailwind
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
      - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
        with:
          node-version: 20
          cache: "npm"

      - run: npm ci

      - name: "Drift Detection: tailwind.config.js"
        working-directory: mobile-app/app
        run: |
          export BEFORE=$(openssl sha1 styles.json | sed 's/^.* //')
          npx create-tailwind-rn
          export AFTER=$(openssl sha1 styles.json | sed 's/^.* //')

          if [ "$BEFORE" != "$AFTER" ] ; then
            echo "Drift detected: tailwind.config.js, please run 'npx create-tailwind-rn' in the /app directory."
            exit 1
          fi