Skip to content

build(deps): bump golang.org/x/sys from 0.47.0 to 0.48.0 #6300

build(deps): bump golang.org/x/sys from 0.47.0 to 0.48.0

build(deps): bump golang.org/x/sys from 0.47.0 to 0.48.0 #6300

Workflow file for this run

name: CI Workflow
on:
# Run this workflow every time a new commit pushed to upstream/fork repository.
# Run workflow on fork repository will help contributors find and resolve issues before sending a PR.
pull_request:
push:
# Exclude branches created by Dependabot to avoid triggering current workflow
# for PRs initiated by Dependabot.
branches-ignore:
- 'dependabot/**'
permissions:
contents: read # for actions/checkout to fetch code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REGISTRY: docker.io
IMAGE_REPO: ${{ secrets.IMAGE_REPO || 'projecthami/hami' }}
IMAGE_REPO_HAMICORE: ${{ secrets.IMAGE_REPO || 'projecthami/hamicore' }}
IMAGE_ROOT_PATH: docker
BUILD_PLATFORM: linux/arm64,linux/amd64
REGISTER_USER: ${{ github.actor }}
REGISTER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
lint:
name: lint
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- name: verify license
run: hack/verify-license.sh
- name: go tidy
run: make tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
with:
version: v2.13.1
install-mode: goinstall
- name: import alias
run: hack/verify-import-aliases.sh
get_info:
name: get_info
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.parse_version.outputs.version }}
e2e_run: ${{ steps.parse_code.outputs.e2e_run }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Parse the version
id: parse_version
run: |
value=$(make -f Makefile.defs print-version)
suffix="$(git rev-parse --short HEAD)"
tag="${value}-${suffix}"
echo "version=${tag}" >> $GITHUB_OUTPUT
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
# Check the code diff, ignore the docs and examples change
- name: Parse the code diff
id: parse_code
run: |
pr_commit=${{ github.event.pull_request.base.sha }}
base_commit=${{ github.sha }}
echo "PR commit: ${pr_commit}"
echo "Git log: $(git log ${pr_commit})"
echo "Base commit: ${base_commit}"
echo "Git log: $(git log ${base_commit})"
changed_files=$(git diff --name-only ${pr_commit} ${base_commit} -- . ':(exclude)docs/*' ':(exclude)examples/*' ':(exclude)*.md')
echo "Changed files: ${changed_files}"
if [ -n "$changed_files" ]; then
echo "Will run e2e-test"
echo "e2e_run=true" >> $GITHUB_OUTPUT
else
echo "Won't run e2e-test"
echo "e2e_run=false" >> $GITHUB_OUTPUT
fi
test:
name: Unit test
needs: [ lint, get_info ] # rely on lint & get_info successful completion
runs-on: ubuntu-22.04
if: needs.get_info.outputs.e2e_run == 'true' || github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Checkout submodule
uses: Mushus/checkout-submodule@f6a7fddc9798c8f8728b252594243ced3b56e550 # v1.0.1
with:
basePath: # optional, default is .
submodulePath: libvgpu
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- run: make tidy
- run: make test
- name: Upload coverage to Codecov
# Prevent running from the forked repository that doesn't need to upload coverage.
# In addition, running on the forked repository would fail as missing the necessary secret.
if: ${{ github.repository == 'Project-HAMi/HAMi' }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
# Even though token upload token is not required for public repos,
# but adding a token might increase successful uploads as per:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
token: ${{secrets.CODECOV_TOKEN}}
files: ./_output/coverage/coverage.out
flags: unittests
fail_ci_if_error: false
verbose: true
build:
name: Compile
needs: [ test, get_info ]
runs-on: ubuntu-22.04
if: needs.get_info.outputs.e2e_run == 'true'
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
echo "=========original CI disk space"
df -h
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "=========after clean up, the left CI disk space"
df -h
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Checkout submodule
uses: Mushus/checkout-submodule@f6a7fddc9798c8f8728b252594243ced3b56e550 # v1.0.1
with:
basePath: # optional, default is .
submodulePath: libvgpu
- name: Set up QEMU
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
with:
driver-opts: image=moby/buildkit:v0.31.2@sha256:2f5adac4ecd194d9f8c10b7b5d7bceb5186853db1b26e5abd3a657af0b7e26ec
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}
- name: Build & Pushing hami image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: ${{ env.IMAGE_ROOT_PATH }}/Dockerfile
labels: ${{ needs.get_info.outputs.version }}
build-args: |
VERSION=${{ needs.get_info.outputs.version }}
GOLANG_IMAGE=golang:1.27.0-bookworm@sha256:ded31c68586d2e49e760acc2e65a884b23d032e9bbbed0ae0c55abd3fcaf4452
NVIDIA_IMAGE=nvidia/cuda:13.3.0-cudnn-devel-ubi8@sha256:e5b2b971730b6d0defd6d1bd7697630e0e599c359190cc4351e3032134e7b401
DEST_DIR=/usr/local
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:${{ needs.get_info.outputs.version }}
push: false
load: true
github-token: ${{ env.REGISTER_PASSWORD }}
- name: List images
run: |
docker images
- name: Save Docker image to image.tar
run: |
docker save ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }}:${{ needs.get_info.outputs.version }} -o image.tar
- name: Upload image.tar as artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: hami-image
path: image.tar
retention-days: 5
if-no-files-found: error
# packages tgz from /charts of original branch, deploy to /charts of target branch
package_chart:
runs-on: ubuntu-22.04
needs: [ test, get_info ]
if: needs.get_info.outputs.e2e_run == 'true'
env:
HELM_VERSION: v3.8.1
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5
with:
version: ${{ env.HELM_VERSION }}
- name: Add HAMi DRA Helm repository
run: |
helm repo add hami-dra https://project-hami.github.io/HAMi-DRA/
helm repo update hami-dra
- name: Build helm dependencies
run: |
helm dependency build charts/hami
- name: Lint helm chart
run: |
make lint_chart
- name: Package Chart
continue-on-error: false
env:
VERSION: ${{ needs.get_info.outputs.version }}
run: |
cd charts
make clean
make
if ! ls *.tgz &>/dev/null ; then
echo "failed to generate chart"
exit 1
fi
cd ..
mkdir -p tmp
mv charts/*.tgz tmp
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: chart_package_artifact
path: tmp/*
retention-days: 5
if-no-files-found: error
# execute a full e2e test when hami code merge
e2e_test:
uses: ./.github/workflows/call-e2e.yaml
needs: [ package_chart, get_info, build ]
if: needs.get_info.outputs.e2e_run == 'true'
with:
ref: ${{ needs.get_info.outputs.version }}
type: "pullrequest"
# execute MIG smoke test when hami code merge
e2e_mig_test:
uses: ./.github/workflows/call-e2e-mig.yaml
needs: [ package_chart, get_info, build, e2e_test ]
if: needs.get_info.outputs.e2e_run == 'true' && vars.ENABLE_MIG_E2E == 'true'
with:
ref: ${{ needs.get_info.outputs.version }}
type: "smoke"
deploy-type: "pullrequest"