Skip to content

Testing isolation experiment #96

Testing isolation experiment

Testing isolation experiment #96

Workflow file for this run

# Copyright 2024 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.
name: 🛠️ Test
on:
push:
branches: main
pull_request:
workflow_dispatch: # Manual runs
jobs:
affected:
runs-on: ubuntu-latest
outputs:
python: ${{steps.python.outputs.affected}}
defaults:
run:
working-directory: .github/testing
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- run: bun install
- id: python
run: |
AFFECTED_PYTHON=$(bun run affected python HEAD origin/main)
echo "$AFFECTED_PYTHON"
echo "affected=$AFFECTED_PYTHON" >> "$GITHUB_OUTPUT"
Python:
needs: affected
runs-on: ubuntu-latest
strategy:
matrix:
affected: ${{fromJson(needs.affected.outputs.python)}}
# Needed to generate the identity token for google-github-actions/auth.
# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-google-cloud-platform
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
GOOGLE_CLOUD_PROJECT: jss-22p1-test
defaults:
run:
working-directory: .github/testing
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: 'google-github-actions/auth@v2'
with:
project_id: jss-22p1-test
workload_identity_provider: projects/886556137211/locations/global/workloadIdentityPools/github-actions/providers/github-actions-python
- run: pip install nox
- run: bun install
- run: bun run tests python AFFECTED
env:
AFFECTED: ${{toJson(matrix.affected)}}