Skip to content

Changed how I get yaml files from the examples dir #7

Changed how I get yaml files from the examples dir

Changed how I get yaml files from the examples dir #7

name: cdk-synth
on:
push: {}
pull_request: {}
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup-matrix.outputs.example-config-files }}
steps:
- uses: actions/checkout@v4
- name: Setup matrix
id: setup-matrix
run: |
file_list=$(find ./Examples/ -regextype egrep -regex '.*ya?ml$')
json_list=$(echo $file_list | jq --raw-input --compact-output 'split(" ")')
echo "example-config-files=$json_list" >> "$GITHUB_OUTPUT"
cdk-synth-examples:
runs-on: ubuntu-latest
needs:
- setup-matrix
strategy:
matrix:
example-config: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: ./.github/workflows/composite-setup-python
- name: Install CDK
run: npm install -g aws-cdk
- name: Synthesize CDK Examples
run: make cdk-synth config-file="${{ matrix.example-config }}"