Skip to content

Improve CI scalability #39

Improve CI scalability

Improve CI scalability #39

Workflow file for this run

name: staging-check
on:
pull_request:
branches: [ master ]
jobs:
detect-changed-services:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Collect all changed root directories
id: changed-root-directories
uses: tj-actions/changed-files@v45
with:
dir_names: true
dir_names_max_depth: '1'
- name: Collect all changed services
id: changed-services
env:
all_changed_files: ${{ steps.changed-root-directories.outputs.all_changed_files }}
run: |
CHANGED_SERVICES=()
for file in ${all_changed_files}; do
if [ -e "$file/infra/Pulumi.yaml" ]; then
CHANGED_SERVICES+=("\"$file\"")
fi
done
echo "changed_services=[${CHANGED_SERVICES[@]}]"
echo "changed_services=[${CHANGED_SERVICES[@]}]" >> "$GITHUB_OUTPUT"
outputs:
changed_services: ${{ steps.changed-services.outputs.changed_services }}
service-check-build:
runs-on: ubuntu-latest
needs: detect-changed-services
strategy:
matrix:
service: ${{ fromJSON(needs.detect-changed-services.outputs.changed_services) }}
steps:
- name: Print service
env:
service: ${{ matrix.service }}
run: |
echo "$service"