Skip to content

Update testScheduler.yml #21

Update testScheduler.yml

Update testScheduler.yml #21

Workflow file for this run

name: Dynamic Matrix Workflow
on:
push:
branches:
- main
- ci/test-automation
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
dynamic-matrix: ${{ steps.convert-to-json.outputs.matrix }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Convert YAML to JSON
id: convert-to-json
run: |
json_output=$(yq eval -o=json .github/data/region.yml)
matrix_json=$(echo $json_output | jq -r '.regions | to_entries | map(.key as $service | .value[] | {service: $service, region: .}) | @json')
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
run-instances:
needs: prepare-matrix
runs-on: ubuntu-latest
strategy:
matrix:
region_service: ${{ fromJSON(needs.prepare-matrix.outputs.dynamic-matrix) }}
steps:
- name: Display matrix values
run: |
echo "Running for service: ${{ matrix.region_service.service }}"
echo "Running in region: ${{ matrix.region_service.region }}"
${{ secrets }}
call-workflow:
needs: prepare-matrix
strategy:
fail-fast: false
matrix:
region_service: ${{ fromJSON(needs.prepare-matrix.outputs.dynamic-matrix) }}
uses: ./.github/workflows/execute.yml
with:
agent: ${{ matrix.region_service.service }}
region: ${{ matrix.region_service.region }}
secrets:
access_key: ${{ secrets.NCLOUD_ACCESS_KEY }}
secret_key: ${{ secrets.NCLOUD_SECRET_KEY }}