diff --git a/.github/workflows/___build_variants.yml b/.github/workflows/___build_variants.yml index f594d05..c8bbba0 100644 --- a/.github/workflows/___build_variants.yml +++ b/.github/workflows/___build_variants.yml @@ -7,10 +7,7 @@ on: type: string required: false default: "types" - types: - type: string - required: true - image_variants: + matrix_include: type: string required: true runs-on: @@ -36,7 +33,7 @@ jobs: strategy: max-parallel: 3 matrix: - include: ${{ fromJson(inputs.image_variants) }} + include: ${{ fromJson(inputs.matrix_include) }} steps: - name: test env: diff --git a/.github/workflows/__generate_image_variants.yml b/.github/workflows/__generate_image_variants.yml index 8b89a3c..34f647a 100644 --- a/.github/workflows/__generate_image_variants.yml +++ b/.github/workflows/__generate_image_variants.yml @@ -12,23 +12,34 @@ on: value: ${{ jobs.variants.outputs.values }} jobs: + yq: + runs-on: ubuntu-latest + steps: + - env: + VALUE: | + - variant: "" + configure_append: "" + optimize_options_c_cpp: "-O2" + optimize_options_ld: "-O1" + - variant: "-debug" + configure_append: "--enable-debug" + optimize_options_c_cpp: "-O0" + optimize_options_ld: "-O0" + - variant: "-opt" + configure_append: "" + optimize_options_c_cpp: "-O3" + optimize_options_ld: "-O2" + id: yq + run: | + echo values="${VALUE}" | yq -o=json >> $GITHUB_OUTPUT + outputs: + values: ${{ steps.yq.outputs.values }} mixin: + needs: yq uses: ./.github/workflows/_mixin_values.yml with: - base_json: ${{ inputs.php_versions_json }} - mixin_yaml: | - - variant: "" - configure_append: "" - optimize_options_c_cpp: "-O2" - optimize_options_ld: "-O1" - - variant: "-debug" - configure_append: "--enable-debug" - optimize_options_c_cpp: "-O0" - optimize_options_ld: "-O0" - - variant: "-opt" - configure_append: "" - optimize_options_c_cpp: "-O3" - optimize_options_ld: "-O2" + base: ${{ inputs.php_versions_json }} + join: ${{ needs.yq.outputs.values }} variants: needs: mixin runs-on: ubuntu-latest diff --git a/.github/workflows/_mixin_values.yml b/.github/workflows/_mixin_values.yml index b448a11..e119df8 100644 --- a/.github/workflows/_mixin_values.yml +++ b/.github/workflows/_mixin_values.yml @@ -3,10 +3,10 @@ name: _Mixin values on: workflow_call: inputs: - base_json: + base: type: string required: true - mixin_yaml: + join: type: string required: true outputs: @@ -20,11 +20,11 @@ jobs: steps: - id: mixin env: - BASE: ${{ inputs.base_json }} - MIXIN: ${{ inputs.mixin_yaml }} + BASE: ${{ inputs.base }} + JOIN: ${{ inputs.join }} run: | echo "${BASE}" > "base.json" - echo "${MIXIN}" | yq -o=json > "mixin.json" - echo values=$(jq --argjson "mixin" "$(cat "mixin.json")" '[.[] | $mixin[] as $y | . + $y]' "base.json") >> $GITHUB_OUTPUT + echo "${MIXIN}" > "join.json" + echo values=$(jq --argjson "mixin" "$(cat "join.json")" '[.[] | $mixin[] as $y | . + $y]' "base.json") >> $GITHUB_OUTPUT outputs: values: ${{ steps.mixin.outputs.values }} diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 5f88b29..445776b 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -36,10 +36,15 @@ jobs: echo values=$(ls "types" | jq -R -s -c 'split("\n")[:-1]') >> $GITHUB_OUTPUT outputs: values: ${{ steps.determine_types.outputs.values }} + mixin_types: + needs: ["determine_php_versions", "determine_types"] + uses: ./.github/workflows/_mixin_values.yml + with: + base: ${{ needs.determine_php_versions.outputs.values }} + join: ${{ needs.determine_types.outputs.values }} build_variants: - needs: ["determine_types", "generate_image_variants"] + needs: mixin_types uses: ./.github/workflows/___build_variants.yml with: - types: ${{ needs.determine_types.outputs.values }} - image_variants: ${{ needs.generate_image_variants.outputs.values }} + matrix_include: ${{ needs.mixin_types.outputs.values }} enable_minor: true