name: Frontend CI permissions: contents: read on: pull_request: paths: - 'fe-app-tachyon/**' - 'luci-app-tachyon/po/**' - '.github/workflows/frontend-ci.yml' push: branches: - main paths: - 'fe-app-tachyon/**' - 'luci-app-tachyon/po/**' - '.github/workflows/frontend-ci.yml' jobs: frontend-checks: name: Frontend Quality Checks runs-on: ubuntu-24.04 defaults: run: working-directory: fe-app-tachyon steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '22' cache: npm cache-dependency-path: fe-app-tachyon/package-lock.json - name: Install dependencies run: npm ci - name: Check formatting id: format run: | npm run format if ! git diff --exit-code; then echo "::error::Code is not formatted. Run 'npm run format' locally." exit 1 fi - name: Run linter run: npm run lint -- --max-warnings=0 - name: Run tests run: npm test -- --run - name: Check translation extraction id: locale_extract run: | npm run locales:extract-calls if ! git diff --exit-code -- locales/calls.json; then echo "::error::Translation call index is stale. Run 'npm run locales:extract-calls' locally." exit 1 fi - name: Check distributed locales id: locale_distribute run: | npm run locales:distribute if ! git diff --exit-code -- ../luci-app-tachyon/po; then echo "::error::LuCI locale copies are stale. Run 'npm run locales:distribute' locally." exit 1 fi - name: Build project id: build run: | npm run build if ! git diff --exit-code -- ../luci-app-tachyon/htdocs; then echo "::error::Build generated changes. Check build output." exit 1 fi - name: Summary if: always() run: | echo "## Frontend CI Results" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "- Format check: ${{ steps.format.outcome }}" >> $GITHUB_STEP_SUMMARY echo "- Translation extraction: ${{ steps.locale_extract.outcome }}" >> $GITHUB_STEP_SUMMARY echo "- Locale distribution: ${{ steps.locale_distribute.outcome }}" >> $GITHUB_STEP_SUMMARY echo "- Overall lint/tests status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY echo "- Build: ${{ steps.build.outcome }}" >> $GITHUB_STEP_SUMMARY