Skip to content

Bump ubi9/ubi-minimal from 9.4 to 9.8 (#4) #50

Bump ubi9/ubi-minimal from 9.4 to 9.8 (#4)

Bump ubi9/ubi-minimal from 9.4 to 9.8 (#4) #50

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_NAME: ghcr.io/project-hami/amd-device-plugin
BUILDER_IMAGE: amd-device-plugin-builder:${{ github.sha }}
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
submodules: true
- name: Verify amd-hami-core submodule
run: |
test -d ./amd-hami-core
test -f ./amd-hami-core/Makefile.hip
test -f ./amd-hami-core/CMakeLists.txt.hip
test -d ./amd-hami-core/src
test -s ./scripts/amd-vgpu-init.sh
sh -n ./scripts/amd-vgpu-init.sh
# The package uses cgo with AMD SMI and libdrm_amdgpu. Reusing the
# Dockerfile builder keeps CI on the exact SDK used by release images.
- name: Build cgo builder image
run: docker build --target builder --tag "${BUILDER_IMAGE}" .
- name: Run unit tests in AMD SMI builder
run: >-
docker run --rm
--workdir /go/src/github.com/Project-HAMi/amd-device-plugin
--env LD_LIBRARY_PATH=/opt/rocm/lib
"${BUILDER_IMAGE}"
bash -c 'ln -sf libamd_smi.so /opt/rocm/lib/libamd_smi.so.26 && go test ./...'
helm:
name: Lint Helm chart
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
submodules: true
- name: Install Helm
uses: azure/setup-helm@v5
with:
version: v3.20.2
- name: Lint chart
run: helm lint ./helm/amd-gpu
- name: Render chart
run: helm template amd-gpu ./helm/amd-gpu --namespace kube-system >/dev/null
image:
name: Build and publish image
needs:
- test
- helm
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Generate image metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and optionally publish image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max