-
Notifications
You must be signed in to change notification settings - Fork 98
130 lines (124 loc) · 4.96 KB
/
docker_images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: 'Compiler and misc docker images build'
on:
workflow_dispatch:
inputs:
GIT_REPO:
description: 'Repo (owner/repo)'
required: true
default: 'kernelci/kernelci-core'
GIT_BRANCH:
description: 'Branch'
required: true
default: 'main'
env:
USER_GIT_REPO: ${{ github.event.inputs.GIT_REPO }}
USER_GIT_BRANCH: ${{ github.event.inputs.GIT_BRANCH }}
jobs:
docker-compiler-build:
strategy:
fail-fast: false
matrix:
kciarch: [ 'arc', 'arm', 'armv5', 'arm64', 'x86', 'mips', 'riscv64' ]
kcicmd: [ 'clang-15 kselftest kernelci',
'clang-17 kselftest kernelci',
'gcc-12 kselftest kernelci'
]
# only selected people can trigger this job
if: contains('["nuclearcat","JenySadadia","a-wai","broonie","laura-nao"]', github.actor)
runs-on: ubuntu-22.04
environment: deploydocker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ env.USER_GIT_REPO }}
ref: ${{ env.USER_GIT_BRANCH }}
submodules: recursive
fetch-depth: 0
path: kernelci-core
- name: Prepare necessary tools
run: |
sudo apt-get update
sudo apt-get remove containerd.io
sudo apt-get install -y python3-pip git docker.io python3-docker
pip3 install --upgrade pip
cd kernelci-core
python3 -m pip install '.[dev]'
sudo cp -R config /etc/kernelci/
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build base kernelci docker image for main branch
if: ${{ env.USER_GIT_BRANCH }} == 'main'
run: |
cd kernelci-core
export core_rev=$(git rev-parse HEAD)
export core_url=$(git remote get-url origin)
kci_arg="build --push --build-arg core_rev=$core_rev --prefix=ghcr.io/${{ github.actor }}/ --build-arg core_url=$core_url"
./kci docker $kci_arg ${{ matrix.kcicmd }} --arch ${{ matrix.kciarch }}
- name: build base kernelci docker image for other branches
if: ${{ env.USER_GIT_BRANCH }} != 'main'
run: |
cd kernelci-core
export core_rev=$(git rev-parse HEAD)
export core_url=$(git remote get-url origin)
kci_arg="build --push --build-arg core_rev=$core_rev --prefix=ghcr.io/staging-${{ github.actor }}/ --build-arg core_url=$core_url"
./kci docker $kci_arg ${{ matrix.kcicmd }} --arch ${{ matrix.kciarch }}
docker-misc-build:
strategy:
fail-fast: false
matrix:
kcicmd: [ 'gcc-12 kunit kernelci --arch x86',
'rustc-1.74 kselftest kernelci --arch x86',
'rustc-1.75 kselftest kernelci --arch x86',
'kernelci',
'k8s kernelci',
'qemu',
]
# only selected people can trigger this job
if: contains('["nuclearcat","JenySadadia","a-wai","broonie","laura-nao"]', github.actor)
runs-on: ubuntu-22.04
environment: deploydocker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ env.USER_GIT_REPO }}
ref: ${{ env.USER_GIT_BRANCH }}
submodules: recursive
fetch-depth: 0
path: kernelci-core
- name: Prepare necessary tools
run: |
sudo apt-get update
sudo apt-get remove containerd.io
sudo apt-get install -y python3-pip git docker.io python3-docker
pip3 install --upgrade pip
cd kernelci-core
python3 -m pip install '.[dev]'
sudo cp -R config /etc/kernelci/
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build base kernelci docker image for main branch
if: ${{ env.USER_GIT_BRANCH }} == 'main'
run: |
cd kernelci-core
export core_rev=$(git rev-parse HEAD)
export core_url=$(git remote get-url origin)
kci_arg="build --push --build-arg core_rev=$core_rev --prefix=ghcr.io/${{ github.actor }}/ --build-arg core_url=$core_url"
./kci docker $kci_arg ${{ matrix.kcicmd }}
- name: build base kernelci docker image for other branches
if: ${{ env.USER_GIT_BRANCH }} != 'main'
run: |
cd kernelci-core
export core_rev=$(git rev-parse HEAD)
export core_url=$(git remote get-url origin)
kci_arg="build --push --build-arg core_rev=$core_rev --prefix=ghcr.io/staging-${{ github.actor }}/ --build-arg core_url=$core_url"
./kci docker $kci_arg ${{ matrix.kcicmd }}