Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi committed Jul 12, 2024
1 parent a6bc182 commit 844c958
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/___build_variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,7 +33,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
include: ${{ fromJson(inputs.image_variants) }}
include: ${{ fromJson(inputs.matrix_include) }}
steps:
- name: test
env:
Expand Down
39 changes: 25 additions & 14 deletions .github/workflows/__generate_image_variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_mixin_values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
11 changes: 8 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 844c958

Please sign in to comment.