Skip to content

Commit 82634d8

Browse files
committed
ci(workflows): add file tool installation and update runner
- Add step to install`file` verification tool in build-pvm-guest-vmlinux and release-one-click workflows - Change release job runner from`arc-runner-set-16c32g`to`ubuntu-latest` Signed-off-by: jinlong <jinlong@tencent.com>
1 parent a3fbcd2 commit 82634d8

4 files changed

Lines changed: 69 additions & 24 deletions

File tree

.github/workflows/build-pvm-guest-vmlinux.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env:
1818
jobs:
1919
build:
2020
runs-on: arc-runner-set-16c32g-containerd
21+
container:
22+
image: ubuntu:24.04
2123
permissions:
2224
contents: read
2325
outputs:
@@ -27,6 +29,11 @@ jobs:
2729
- name: Checkout
2830
uses: actions/checkout@v4
2931

32+
- name: Install verification tools
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y file
36+
3037
- name: Free disk space
3138
uses: jlumbroso/free-disk-space@main
3239
with:

.github/workflows/build-vmlinux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ env:
1515
jobs:
1616
build:
1717
runs-on: arc-runner-set-16c32g-containerd
18+
container:
19+
image: ubuntu:24.04
1820
permissions:
1921
contents: read
2022

.github/workflows/release-one-click.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@ jobs:
2727
build_pvm_guest_vmlinux:
2828
name: Build PVM guest vmlinux for release
2929
runs-on: arc-runner-set-16c32g-containerd
30+
container:
31+
image: ubuntu:24.04
3032

3133
steps:
3234
- name: Checkout
3335
uses: actions/checkout@v4
3436

37+
- name: Install verification tools
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y file
41+
3542
- name: Free disk space
3643
uses: jlumbroso/free-disk-space@main
3744
with:
@@ -101,7 +108,7 @@ jobs:
101108
retention-days: 14
102109

103110
release:
104-
runs-on: arc-runner-set-16c32g
111+
runs-on: ubuntu-latest
105112
needs: build_pvm_guest_vmlinux
106113

107114
steps:

.github/workflows/release-pvm-host-kernel.yml

Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,11 @@ permissions:
1414
contents: write
1515

1616
jobs:
17-
build:
18-
name: Build PVM host kernel (${{ matrix.package_type }})
17+
build_deb:
18+
name: Build PVM host kernel (deb)
1919
runs-on: arc-runner-set-16c32g-containerd
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
include:
24-
- package_type: deb
25-
build_mode: native
26-
- package_type: rpm
27-
build_mode: container
28-
container_image: fedora:40
20+
container:
21+
image: ubuntu:24.04
2922

3023
steps:
3124
- name: Checkout
@@ -43,43 +36,79 @@ jobs:
4336
swap-storage: true
4437

4538
- name: Build DEB package
46-
if: matrix.build_mode == 'native'
4739
run: |
4840
WORK_DIR="${GITHUB_WORKSPACE}/pvm-host-build" \
4941
OUTPUT_DIR="${GITHUB_WORKSPACE}/pvm-host-build/output" \
5042
bash deploy/pvm/build-pvm-host-kernel-pkg.sh
5143
44+
- name: Verify package artifacts
45+
run: |
46+
shopt -s nullglob
47+
packages=(pvm-host-build/output/*.deb)
48+
if [[ "${#packages[@]}" -eq 0 ]]; then
49+
echo "No deb packages were produced" >&2
50+
exit 1
51+
fi
52+
ls -lh "${packages[@]}"
53+
54+
- name: Upload package artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: pvm-host-kernel-deb-${{ github.ref_name }}
58+
path: pvm-host-build/output/*.deb
59+
if-no-files-found: error
60+
retention-days: 14
61+
62+
build_rpm:
63+
name: Build PVM host kernel (rpm)
64+
runs-on: arc-runner-set-16c32g-containerd
65+
container:
66+
image: opencloudos/opencloudos9-minimal:latest
67+
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v4
71+
72+
- name: Switch OpenCloudOS repos to Tencent mirrors
73+
run: |
74+
set -euo pipefail
75+
sed -i "s#https://mirrors.opencloudos.tech/opencloudos/#https://mirrors.tencent.com/opencloudos/#g" /etc/yum.repos.d/OpenCloudOS.repo
76+
if [[ -f /etc/yum.repos.d/epol.repo ]]; then
77+
sed -i "s#http://mirrors.tencent.com/epol/#https://mirrors.tencent.com/epol/#g" /etc/yum.repos.d/epol.repo
78+
fi
79+
dnf clean all
80+
rm -rf /var/cache/dnf/*
81+
5282
- name: Build RPM package
53-
if: matrix.build_mode == 'container'
5483
run: |
55-
docker run --rm \
56-
-v "${GITHUB_WORKSPACE}:/workspace" \
57-
-w /workspace \
58-
"${{ matrix.container_image }}" \
59-
bash -lc 'WORK_DIR=/workspace/pvm-host-build OUTPUT_DIR=/workspace/pvm-host-build/output bash deploy/pvm/build-pvm-host-kernel-pkg.sh'
84+
WORK_DIR="${GITHUB_WORKSPACE}/pvm-host-build" \
85+
OUTPUT_DIR="${GITHUB_WORKSPACE}/pvm-host-build/output" \
86+
bash deploy/pvm/build-pvm-host-kernel-pkg.sh
6087
6188
- name: Verify package artifacts
6289
run: |
6390
shopt -s nullglob
64-
packages=(pvm-host-build/output/*.${{ matrix.package_type }})
91+
packages=(pvm-host-build/output/*.rpm)
6592
if [[ "${#packages[@]}" -eq 0 ]]; then
66-
echo "No ${{ matrix.package_type }} packages were produced" >&2
93+
echo "No rpm packages were produced" >&2
6794
exit 1
6895
fi
6996
ls -lh "${packages[@]}"
7097
7198
- name: Upload package artifact
7299
uses: actions/upload-artifact@v4
73100
with:
74-
name: pvm-host-kernel-${{ matrix.package_type }}-${{ github.ref_name }}
75-
path: pvm-host-build/output/*.${{ matrix.package_type }}
101+
name: pvm-host-kernel-rpm-${{ github.ref_name }}
102+
path: pvm-host-build/output/*.rpm
76103
if-no-files-found: error
77104
retention-days: 14
78105

79106
publish:
80107
name: Upload PVM host packages to GitHub Release
81108
if: startsWith(github.ref, 'refs/tags/')
82-
needs: build
109+
needs:
110+
- build_deb
111+
- build_rpm
83112
runs-on: ubuntu-latest
84113
permissions:
85114
contents: write

0 commit comments

Comments
 (0)