|
7 | 7 | pull_request: |
8 | 8 | branches: |
9 | 9 | - main |
10 | | - schedule: |
11 | | - - cron: '0 5 * * *' # once daily at 5AM |
12 | 10 | workflow_dispatch: |
13 | 11 | inputs: |
14 | | - cdk-version: |
15 | | - description: Upstream aws-cdk version to use in tests |
| 12 | + node-version: |
16 | 13 | required: false |
| 14 | + default: '22.x' |
| 15 | + python-version: |
| 16 | + required: false |
| 17 | + default: '3.12' |
17 | 18 |
|
18 | 19 | env: |
19 | 20 | AWS_ACCESS_KEY_ID: test |
|
22 | 23 | AWS_DEFAULT_REGION: us-east-1 |
23 | 24 |
|
24 | 25 | jobs: |
25 | | - dynamic-cdk-version-testing: |
| 26 | + generate-cdk-version-matrix: |
26 | 27 | runs-on: ubuntu-latest |
27 | | - |
| 28 | + outputs: |
| 29 | + matrix: ${{ steps.set-matrix.env.MATRIX }} |
| 30 | + steps: |
| 31 | + - name: Use Node.js ${{ inputs.node-version }} |
| 32 | + uses: actions/setup-node@v2 |
| 33 | + with: |
| 34 | + node-version: ${{ inputs.node-version }} |
| 35 | + - name: Obtain aws-cdk versions |
| 36 | + id: set-matrix |
| 37 | + run: | |
| 38 | + VERSIONS_ARRAY=$(npm show aws-cdk time --json --silent| jq 'del(.created, .modified) | keys' -c) |
| 39 | + echo "MATRIX={\"cdk-version\":$( echo "$VERSIONS_ARRAY" )}" >> $GITHUB_ENV |
| 40 | + |
| 41 | + version-testing: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + needs: generate-cdk-version-matrix |
28 | 44 | strategy: |
29 | | - matrix: |
30 | | - node-version: ['22.x'] |
31 | | - python-version: ['3.12'] |
32 | | - cdk-version: ${{ fromJson(inputs.cdk-version || '["2.166.0","2.167.0", ""]') }} |
33 | | - fail-fast: False |
34 | | - |
| 45 | + matrix: ${{fromJson(needs.generate-cdk-version-matrix.outputs.matrix)}} |
35 | 46 |
|
36 | 47 | steps: |
37 | 48 | - uses: actions/checkout@v2 |
38 | 49 | with: |
39 | 50 | path: repo |
40 | 51 |
|
41 | | - - name: Use Node.js ${{ matrix.node-version }} |
| 52 | + - name: Use Node.js ${{ inputs.node-version }} |
42 | 53 | uses: actions/setup-node@v2 |
43 | 54 | with: |
44 | | - node-version: ${{ matrix.node-version }} |
| 55 | + node-version: ${{ inputs.node-version }} |
45 | 56 |
|
46 | | - - name: Setup Python ${{ matrix.python-version }} |
| 57 | + - name: Setup Python ${{ inputs.python-version }} |
47 | 58 | uses: actions/setup-python@v2 |
48 | 59 | with: |
49 | | - python-version: '${{ matrix.python-version }}' |
| 60 | + python-version: '${{ inputs.python-version }}' |
50 | 61 |
|
51 | 62 | - name: Install dependencies for aws-cdk-local |
52 | 63 | working-directory: repo |
|
0 commit comments