Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 1516dca

Browse files
authored
feat: build PRs using matrix strategy (#7)
* feat: build PRs using matrix strategy Some ORT PRs are focussed on the resulting container, so it makes sense to build them too. Use a matrix strategy to build these containers as well. Signed-off-by: Nico Rikken <[email protected]> * chore: try fixing git refs Signed-off-by: Nico Rikken <[email protected]> * chore: try `/ref/pulls` prefix As this is handled seperately in the checkout action. Signed-off-by: Nico Rikken <[email protected]> * chore: prevent fail-fast Prevent fail-fast so that an attempt is made to build all containers. Signed-off-by: Nico Rikken <[email protected]> * chore: rename tern output based on suffix Signed-off-by: Nico Rikken <[email protected]> * chore: remove Porche PR that cannot be built Signed-off-by: Nico Rikken <[email protected]>
1 parent ee4c39b commit 1516dca

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/containerize.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ env:
1414

1515
jobs:
1616
containerize:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- ref: main
22+
suffix: ''
23+
description: 'Main branch'
24+
image_url: 'https://github.com/oss-review-toolkit/ort'
25+
- ref: 'refs/pull/4746/merge'
26+
suffix: '-pr-4746'
27+
description: 'Update Dockerfile to use multi-stage builds by heliocastro'
28+
image_url: 'https://github.com/oss-review-toolkit/ort/pull/4746'
1729
name: containerize
1830
runs-on: ubuntu-latest
1931
steps:
@@ -22,6 +34,7 @@ jobs:
2234
uses: actions/checkout@v3
2335
with:
2436
repository: oss-review-toolkit/ort
37+
ref: ${{ matrix.ref }}
2538

2639
- name: Inspect result
2740
run: ls -la
@@ -30,7 +43,7 @@ jobs:
3043
run: echo "ORT_SHA=$(/usr/bin/git rev-parse --short HEAD)" >> $GITHUB_ENV
3144

3245
- name: Lowercase image name based on repo
33-
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
46+
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}${{ matrix.suffix }}" >> ${GITHUB_ENV}
3447

3548
- name: Shorten repo SHA
3649
run: echo "REPO_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
@@ -82,8 +95,8 @@ jobs:
8295
docker build \
8396
--label org.opencontainers.image.title=ort-containers.image.title=${{ github.event.repository.name }} \
8497
--label ort.opencontainers.image.description="A temporary solution to provide a ORT Container." \
85-
--label org.opencontainers.image.url="${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}" \
86-
--label org.opencontainers.image.source="${{ env.GITHUB_SERVER_URL }}/${{ env.GITHUB_REPOSITORY }}" \
98+
--label org.opencontainers.image.url="${{ matrix.image_url }}" \
99+
--label org.opencontainers.image.source="${{ matrix.image_url }}" \
87100
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:builder-sha-${{ env.REPO_SHA }} \
88101
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:date-${{ env.DATE }} \
89102
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:ort-sha-${{ env.ORT_SHA }} \
@@ -96,7 +109,7 @@ jobs:
96109
- name: Store results
97110
uses: actions/upload-artifact@v3
98111
with:
99-
name: tern-output-${{ env.DATE }}-${{ env.SHORT_IMAGE_ID }}
112+
name: tern-output${{ matrix.suffix}}-${{ env.DATE }}-${{ env.SHORT_IMAGE_ID }}
100113
path: ${{ github.workspace }}/tern-analysis-${{ env.DATE }}-${{ env.SHORT_IMAGE_ID }}.txt
101114

102115
- name: Push Docker image

0 commit comments

Comments
 (0)