Skip to content

Commit a318776

Browse files
authored
[CI] Refactor sycl-containers to use matrix (intel#13292)
Address review comments from intel#13272 (comment)
1 parent 4af7a98 commit a318776

File tree

1 file changed

+25
-78
lines changed

1 file changed

+25
-78
lines changed

.github/workflows/sycl-containers.yaml

Lines changed: 25 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,31 @@ on:
2424
permissions: read-all
2525

2626
jobs:
27-
base_image_ubuntu2204:
27+
build_and_push_images:
2828
if: github.repository == 'intel/llvm'
29-
name: Base Ubuntu 22.04 Docker image
29+
name: Build and Push Docker Images
3030
runs-on: ubuntu-22.04
3131
permissions:
3232
packages: write
33+
strategy:
34+
matrix:
35+
include:
36+
- name: Base Ubuntu 22.04 Docker image
37+
file: ubuntu2204_base
38+
tags: ubuntu2204_base
39+
build_args: ""
40+
- name: Build Ubuntu Docker image
41+
file: ubuntu2204_build
42+
tags: ubuntu2204_build
43+
build_args: ""
44+
- name: Intel Drivers Ubuntu 22.04 Docker image
45+
file: ubuntu2204_intel_drivers
46+
tags: ubuntu2204_intel_drivers
47+
build_args: "use_latest=false"
48+
- name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
49+
file: ubuntu2204_intel_drivers
50+
tags: ubuntu2204_intel_drivers_unstable
51+
build_args: "use_latest=true"
3352
steps:
3453
- name: Checkout
3554
uses: actions/checkout@v4
@@ -39,83 +58,11 @@ jobs:
3958
uses: ./devops/actions/build_container
4059
with:
4160
push: ${{ github.event_name != 'pull_request' }}
42-
file: ubuntu2204_base
61+
file: ${{ matrix.file }}
4362
username: ${{ github.repository_owner }}
4463
password: ${{ secrets.GITHUB_TOKEN }}
4564
tags: |
46-
ghcr.io/${{ github.repository }}/ubuntu2204_base:${{ github.sha }}
47-
ghcr.io/${{ github.repository }}/ubuntu2204_base:latest
48-
build_image_ubuntu2204:
49-
if: github.repository == 'intel/llvm'
50-
name: Build Ubuntu Docker image
51-
runs-on: ubuntu-22.04
52-
permissions:
53-
packages: write
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@v4
57-
with:
58-
fetch-depth: 2
59-
- name: Build and Push Container
60-
uses: ./devops/actions/build_container
61-
with:
62-
push: ${{ github.event_name != 'pull_request' }}
63-
file: ubuntu2204_build
64-
username: ${{ github.repository_owner }}
65-
password: ${{ secrets.GITHUB_TOKEN }}
66-
tags: |
67-
ghcr.io/${{ github.repository }}/ubuntu2204_build:${{ github.sha }}
68-
ghcr.io/${{ github.repository }}/ubuntu2204_build:latest
65+
ghcr.io/${{ github.repository }}/${{ matrix.tags }}-${{ github.sha }}
66+
ghcr.io/${{ github.repository }}/${{ matrix.tags }}:latest
67+
build-args: ${{ matrix.build_args }}
6968

70-
# This job produces a Docker container with the latest versions of Intel
71-
# drivers, that can be found on GitHub.
72-
drivers_image_ubuntu2204:
73-
if: github.repository == 'intel/llvm'
74-
name: Intel Drivers Ubuntu 22.04 Docker image
75-
runs-on: ubuntu-22.04
76-
permissions:
77-
packages: write
78-
needs: base_image_ubuntu2204
79-
steps:
80-
- name: Checkout
81-
uses: actions/checkout@v4
82-
with:
83-
fetch-depth: 2
84-
- name: Build and Push Container
85-
uses: ./devops/actions/build_container
86-
with:
87-
push: ${{ github.event_name != 'pull_request' }}
88-
file: ubuntu2204_intel_drivers
89-
username: ${{ github.repository_owner }}
90-
password: ${{ secrets.GITHUB_TOKEN }}
91-
tags: |
92-
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest-${{ github.sha }}
93-
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:latest
94-
build-args: |
95-
use_latest=false
96-
# This job produces a Docker container with the latest versions of Intel
97-
# drivers, that can be found on GitHub.
98-
drivers_image_ubuntu2204_unstable:
99-
if: github.repository == 'intel/llvm'
100-
name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
101-
runs-on: ubuntu-22.04
102-
permissions:
103-
packages: write
104-
needs: base_image_ubuntu2204
105-
steps:
106-
- name: Checkout
107-
uses: actions/checkout@v4
108-
with:
109-
fetch-depth: 2
110-
- name: Build and Push Container
111-
uses: ./devops/actions/build_container
112-
with:
113-
push: ${{ github.event_name != 'pull_request' }}
114-
file: ubuntu2204_intel_drivers
115-
username: ${{ github.repository_owner }}
116-
password: ${{ secrets.GITHUB_TOKEN }}
117-
tags: |
118-
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable-${{ github.sha }}
119-
ghcr.io/${{ github.repository }}/ubuntu2204_intel_drivers:unstable
120-
build-args: |
121-
use_latest=true

0 commit comments

Comments
 (0)