Skip to content

refactor(ocaml): refactoring ocaml-diff (#25) #6

refactor(ocaml): refactoring ocaml-diff (#25)

refactor(ocaml): refactoring ocaml-diff (#25) #6

Workflow file for this run

name: Build benchmark images
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
jobs:
find-targets:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- id: find-targets
run: |
projects=$(git diff --name-only HEAD^ HEAD | grep -e "^OCaml/" -e "^Java/" -e "^C/" -e "^Solidity/" | cut -d '/' -f 1-2 | sort | uniq | xargs -I{prj} echo \"{prj}\" | tr '\n' ',' | sed 's/,*$//')
echo "targets=[$projects]" >> ${GITHUB_OUTPUT}
outputs:
targets: ${{ steps.find-targets.outputs.targets }}
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- find-targets
if: always() && needs.find-targets.outputs.targets != '[]'
strategy:
matrix:
target: ${{ fromJSON(needs.find-targets.outputs.targets) }}
steps:
- uses: actions/checkout@v3
- name: Read metadata
id: read-metadata
run: |
content=$(cat ${{ matrix.target }}/metadata.json)
content="${content//$'\n'/''}"
echo "language=$(echo $content | jq -r .language)" >> ${GITHUB_OUTPUT}
echo "id=$(echo $content | jq -r .id)" >> ${GITHUB_OUTPUT}
- run: |
echo "${{steps.read-metadata.outputs.metadata}}"
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
context: ${{ matrix.target }}
file: ${{ matrix.target }}/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.REGISTRY }}/kupl/starlab-benchmarks/${{ steps.read-metadata.outputs.language }}:${{ steps.read-metadata.outputs.id }}
labels: |
org.opencontainers.image.source="https://github.com/kupl/starlab-benchmarks"