Skip to content

Commit

Permalink
Yet another approach
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
  • Loading branch information
jimmykarily committed Jun 22, 2023
1 parent e415817 commit cba0b30
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 14 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ jobs:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
sudo apt update && sudo apt install -y jq
- id: set-matrix
run: |
content=`cat ./.github/flavors.json`
content=`cat .github/flavors.json | jq '.[] | select(.frameworkonly != "true")'`
# the following lines are only required for multi line json
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
Expand All @@ -34,6 +35,27 @@ jobs:
# end of optional handling for multi line json
# end of optional handling for multi line json
echo "::set-output name=matrix::{\"include\": $content }"
get-framework-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
- id: set-matrix
run: |
content=`cat .github/flavors.json`
# the following lines are only required for multi line json
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
# end of optional handling for multi line json
echo "::set-output name=matrix::{\"include\": $content }"
build:
runs-on: ubuntu-latest
needs:
Expand All @@ -45,10 +67,7 @@ jobs:
security-events: write
strategy:
fail-fast: false
matrix:
${{ insert }}: ${{fromJson(needs.get-matrix.outputs.matrix)}}
exclude:
- flavor: "ubuntu-20-lts-fips"
matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- run: |
Expand Down Expand Up @@ -131,13 +150,13 @@ jobs:
build-framework:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs:
- get-matrix
- get-framework-matrix
runs-on: self-hosted
permissions:
id-token: write
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}}
matrix: ${{fromJson(needs.get-framework-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- run: |
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,28 @@ jobs:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
sudo apt update && sudo apt install -y jq
- id: set-matrix
run: |
content=`cat ./.github/flavors.json`
content=`cat .github/flavors.json | jq '.[] | select(.frameworkonly != "true")'`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=matrix::{\"include\": $content }"
get-framework-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- run: |
git fetch --prune --unshallow
- id: set-matrix
run: |
content=`cat .github/flavors.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
Expand All @@ -26,13 +45,13 @@ jobs:
build-framework:
runs-on: self-hosted
needs:
- get-matrix
- get-framework-matrix
permissions:
id-token: write # OIDC support
contents: write
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}}
matrix: ${{fromJson(needs.get-framework-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- run: |
Expand Down Expand Up @@ -86,10 +105,7 @@ jobs:
security-events: write
strategy:
fail-fast: false
matrix:
${{ insert }}: ${{fromJson(needs.get-matrix.outputs.matrix)}}
exclude:
- flavor: "ubuntu-20-lts-fips"
matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- run: |
Expand Down

0 comments on commit cba0b30

Please sign in to comment.