# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 name: Run Tests on: pull_request concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: contents: read jobs: changes: uses: ./.github/workflows/changes.yml permissions: pull-requests: read build: # Job name is pinned in main branch protection required_status_checks. name: Run Tests (just DevUI tests for now) needs: changes # Builds and tests genkit-tools/ only. # A failed detection still runs the tests; see changes.yml. if: >- ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.tools == 'true' || needs.changes.outputs.other == 'true') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 - name: Set up node v20 uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 20.x cache: pnpm - name: Install dependencies and build run: cd genkit-tools && pnpm install && pnpm build - name: Run tests run: pnpm test:genkit-tools - name: Validate working directory is clean run: .github/workflows/scripts/ensure-clean-working-tree.sh