Skip to content

Commit a067cb6

Browse files
committed
arm runners
1 parent aa097c8 commit a067cb6

File tree

8 files changed

+167
-108
lines changed

8 files changed

+167
-108
lines changed

.github/workflows/ci-alpine-build.yml

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
type: string
2727
jobs:
2828
build-alpine:
29-
runs-on: ubuntu-24.04
29+
runs-on: ubuntu-24.04-arm
3030
strategy:
3131
fail-fast: false
3232
matrix:
@@ -48,25 +48,14 @@ jobs:
4848
env:
4949
qbt_build_dir: "qbt-build"
5050
script_name: ${{ inputs.script_name }}
51+
container_name: "multiarch"
5152

5253
steps:
5354
- name: Checkout ${{ inputs.distinct_id }}
5455
uses: actions/checkout@v4
5556
with:
5657
persist-credentials: false
5758

58-
- name: Host - phased updates ${{ inputs.distinct_id }}
59-
run: printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
60-
61-
- name: Host - update ${{ inputs.distinct_id }}
62-
run: sudo apt-get update
63-
64-
# - name: Host - upgrade ${{ inputs.distinct_id }}
65-
# run: sudo apt-get -y upgrade
66-
67-
- name: Host - set up qemu-user-static binfmt-support ${{ inputs.distinct_id }}
68-
run: sudo apt install libpipeline1 qemu-user-static binfmt-support
69-
7059
- name: Host - Create Docker template env file ${{ inputs.distinct_id }}
7160
env:
7261
set_skip_icu: ${{ inputs.icu }}
@@ -94,71 +83,108 @@ jobs:
9483
printf '%s\n' "qbt_standard=" >> env.custom
9584
printf '%s\n' "qbt_static_ish=" >> env.custom
9685
97-
- name: Host - Create docker multiarch container ${{ inputs.distinct_id }}
98-
run: docker run --name multiarch -it -d --env-file env.custom -w /root -v ${{ github.workspace }}:/root ${{ matrix.os_id }}:${{ matrix.os_version_id }}
86+
# - name: Host - Github env to container ${{ inputs.distinct_id }}
87+
# run: env >> env.custom
88+
89+
- name: Host - check stuff ${{ inputs.distinct_id }}
90+
run: export $(cat env.custom) && bash ${script_name}
91+
92+
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
93+
run: |
94+
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" || -f "disable-qt5" ]]; then
95+
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
96+
printf '%s\n' "Found file: \`disable-qt5\` -> setting env: \`disable_qt5=yes\`" >> $GITHUB_STEP_SUMMARY
97+
fi
98+
99+
- name: Host - phased updates ${{ inputs.distinct_id }}
100+
if: env.disable_qt5 != 'yes'
101+
run: printf '%s\n' 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates
102+
103+
- name: Host - update ${{ inputs.distinct_id }}
104+
if: env.disable_qt5 != 'yes'
105+
run: sudo apt-get update
106+
107+
# - name: Host - upgrade ${{ inputs.distinct_id }}
108+
# run: sudo apt-get -y upgrade
109+
110+
- name: Host - set up qemu-user-static binfmt-support ${{ inputs.distinct_id }}
111+
if: env.disable_qt5 != 'yes'
112+
run: sudo apt install libpipeline1 qemu-user-static binfmt-support
113+
114+
- name: Host - Create docker ${{ env.multiarch }} container ${{ inputs.distinct_id }}
115+
if: env.disable_qt5 != 'yes'
116+
run: |
117+
# We create an Alpine edge container for cross-compilation with a user named gh which has same id as runner 1001 and provide sudo access
118+
# This way we can run commands as a non-root user, avoiding permission issues on host runner. Switching between user and root as needed.
119+
docker run --name ${container_name} -it -d --env-file env.custom -w /home/gh -v ${{ github.workspace }}:/home/gh ${{ matrix.os_id }}:${{ matrix.os_version_id }}
120+
# Create the user gh with the id 1001:1001 which is the same as the runner user id and group id.
121+
docker exec ${container_name} sh -c 'adduser -h /home/gh -Ds /bin/bash -u 1001 gh && apk add sudo'
122+
# Allow the user gh to run sudo without password prompt: docker exec -u gh:gh ${container_name} sudo ls
123+
docker exec ${container_name} sh -c 'printf "%s" "gh ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/gh'
99124
100125
- name: Docker - apk update ${{ inputs.distinct_id }}
101-
run: docker exec -w /root multiarch apk update
126+
if: env.disable_qt5 != 'yes'
127+
run: docker exec ${container_name} apk update
102128

103129
- name: Docker - apk install bash ${{ inputs.distinct_id }}
104-
run: docker exec -w /root multiarch apk add bash
130+
if: env.disable_qt5 != 'yes'
131+
run: docker exec ${container_name} apk add bash
105132

106-
- name: Docker - Bootstrap deps ${{ inputs.distinct_id }}
107-
run: docker exec -w /root multiarch bash ${script_name} bootstrap_deps
133+
- name: Docker - Bootstrap test tools ${{ inputs.distinct_id }}
134+
if: env.disable_qt5 != 'yes'
135+
run: docker exec ${container_name} bash ${script_name} update install_test
108136

109-
- name: Docker - Bootstrap build ${{ inputs.distinct_id }}
110-
run: docker exec -w /root multiarch bash ${script_name} -bs-a
137+
- name: Docker - Bootstrap core deps ${{ inputs.distinct_id }}
138+
if: env.disable_qt5 != 'yes'
139+
run: docker exec ${container_name} bash ${script_name} install_core
111140

112-
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
113-
run: |
114-
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" ]]; then
115-
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
116-
printf '%s\n' "Found file: \`disable-qt5\`: settings \`disable_qt5=yes\` to yes" >> $GITHUB_STEP_SUMMARY
117-
fi
141+
- name: Docker - Bootstrap build ${{ inputs.distinct_id }}
142+
if: env.disable_qt5 != 'yes'
143+
run: docker exec -u gh:gh ${container_name} bash ${script_name} -bs-a
118144

119145
- name: Docker - zlib-ng ${{ inputs.distinct_id }}
120146
if: env.disable_qt5 != 'yes'
121-
run: docker exec -w /root multiarch bash ${script_name} zlib
147+
run: docker exec -u gh:gh ${container_name} bash ${script_name} zlib
122148

123149
- name: Docker - iconv ${{ inputs.distinct_id }}
124150
if: env.disable_qt5 != 'yes'
125-
run: docker exec -w /root multiarch bash ${script_name} iconv
151+
run: docker exec -u gh:gh ${container_name} bash ${script_name} iconv
126152

127153
- name: Docker - icu ${{ inputs.distinct_id }}
128154
if: env.disable_qt5 != 'yes'
129-
run: docker exec -w /root multiarch bash ${script_name} icu
155+
run: docker exec -u gh:gh ${container_name} bash ${script_name} icu
130156

131157
- name: Docker - openssl ${{ inputs.distinct_id }}
132158
if: env.disable_qt5 != 'yes'
133-
run: docker exec -w /root multiarch bash ${script_name} openssl
159+
run: docker exec -u gh:gh ${container_name} bash ${script_name} openssl
134160

135161
- name: Docker - boost ${{ inputs.distinct_id }}
136162
if: env.disable_qt5 != 'yes'
137-
run: docker exec -w /root multiarch bash ${script_name} boost
163+
run: docker exec -u gh:gh ${container_name} bash ${script_name} boost
138164

139165
- name: Docker - libtorrent ${{ inputs.distinct_id }}
140166
if: env.disable_qt5 != 'yes'
141-
run: docker exec -w /root multiarch bash ${script_name} libtorrent
167+
run: docker exec -u gh:gh ${container_name} bash ${script_name} libtorrent
142168

143169
- name: Docker - double_conversion ${{ inputs.distinct_id }}
144170
if: matrix.qbt_build_tool == '' && env.disable_qt5 != 'yes'
145-
run: docker exec -w /root multiarch bash ${script_name} double_conversion
171+
run: docker exec -u gh:gh ${container_name} bash ${script_name} double_conversion
146172

147173
- name: Docker - qtbase ${{ inputs.distinct_id }}
148174
if: env.disable_qt5 != 'yes'
149-
run: docker exec -w /root multiarch bash ${script_name} qtbase
175+
run: docker exec -u gh:gh ${container_name} bash ${script_name} qtbase
150176

151177
- name: Docker - qttools ${{ inputs.distinct_id }}
152178
if: env.disable_qt5 != 'yes'
153-
run: docker exec -w /root multiarch bash ${script_name} qttools
179+
run: docker exec -u gh:gh ${container_name} bash ${script_name} qttools
154180

155181
- name: Docker - qbittorrent ${{ inputs.distinct_id }}
156182
if: env.disable_qt5 != 'yes'
157-
run: docker exec -w /root multiarch bash ${script_name} qbittorrent
183+
run: docker exec -u gh:gh ${container_name} bash ${script_name} qbittorrent
158184

159185
- name: Docker - Set release asset name ${{ inputs.distinct_id }}
160186
if: env.disable_qt5 != 'yes'
161-
run: docker exec -w /root/${{ env.qbt_build_dir }}/completed multiarch mv -f qbittorrent-nox ${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
187+
run: docker exec -u gh:gh -w /home/gh/${{ env.qbt_build_dir }}/completed ${container_name} mv -f qbittorrent-nox ${{ matrix.qbt_cross_name }}-${{ matrix.qbt_qt_version_name }}qbittorrent-nox
162188

163189
- name: Generate artifact attestation ${{ inputs.distinct_id }}
164190
if: env.disable_qt5 != 'yes'
@@ -168,7 +194,7 @@ jobs:
168194

169195
- name: Docker - Release Info ${{ inputs.distinct_id }}
170196
if: env.disable_qt5 != 'yes'
171-
run: docker exec -w /root/${{ env.qbt_build_dir }}/release_info multiarch bash -c 'mv *.md *.json '/root/${{ env.qbt_build_dir }}/completed''
197+
run: docker exec -u gh:gh -w /home/gh/${{ env.qbt_build_dir }}/release_info ${container_name} bash -c 'mv *.md *.json '/home/gh/${{ env.qbt_build_dir }}/completed''
172198

173199
- name: Host - Upload libtorrent-v${{ matrix.qbt_libtorrent_version }}-qbittorrent-nox and release info artifact ${{ inputs.distinct_id }}
174200
if: success() && env.disable_qt5 != 'yes'

.github/workflows/ci-alpine-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
release:
13-
runs-on: ubuntu-24.04
13+
runs-on: ubuntu-24.04-arm
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -36,7 +36,7 @@ jobs:
3636
- name: Pandoc - Bootstrap
3737
run: |
3838
pandoc_git_tag="$(git ls-remote -q -t --refs https://github.com/jgm/pandoc.git | awk '/tags\/[0-9]/{sub("refs/tags/", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n 1)"
39-
curl -sLo- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-amd64.tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
39+
curl -sLo- "https://github.com/jgm/pandoc/releases/latest/download/pandoc-${pandoc_git_tag}-linux-$(dpkg --print-architecture).tar.gz" | tar xzf - --strip-components 2 -C "$(pwd)" --exclude="share"
4040
4141
- name: Host - Download 1.2 qbittorrent-nox artifacts ${{ inputs.distinct_id }}
4242
uses: actions/download-artifact@v4

.github/workflows/ci-auto-rerun-failed-jobs-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
name: rerun - attempt ${{ inputs.attempts }}
2727
permissions:
2828
actions: write
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04-arm
3030
env:
3131
GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}"
3232
steps:

.github/workflows/ci-checks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
sh-checker:
13-
runs-on: ubuntu-24.04
13+
runs-on: ubuntu-24.04-arm
1414
permissions:
1515
contents: read
1616
steps:
@@ -29,7 +29,7 @@ jobs:
2929
sh_checker_exclude: ""
3030

3131
zizmor-checker:
32-
runs-on: ubuntu-24.04
32+
runs-on: ubuntu-24.04-arm
3333
permissions:
3434
contents: read
3535
steps:
@@ -54,7 +54,7 @@ jobs:
5454
exit "$exit_code"
5555
5656
editorconfig-checker:
57-
runs-on: ubuntu-24.04
57+
runs-on: ubuntu-24.04-arm
5858
permissions:
5959
contents: read
6060
steps:

.github/workflows/ci-debian-build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
defaults:
3030
run:
3131
shell: bash
32-
runs-on: ubuntu-24.04
32+
runs-on: ubuntu-24.04-arm
3333
strategy:
3434
fail-fast: false
3535
matrix:
@@ -57,7 +57,7 @@ jobs:
5757
script_name: ${{ inputs.script_name }}
5858

5959
container:
60-
image: ${{ matrix.container_id }}:${{ matrix.container_codename }}
60+
image: arm64v8/${{ matrix.container_id }}:${{ matrix.container_codename }}
6161
env: # container
6262
LANG: C.UTF-8
6363
LC_ALL: C.UTF-8
@@ -89,19 +89,24 @@ jobs:
8989
with:
9090
persist-credentials: false
9191

92-
- name: Bootstrap deps ${{ inputs.distinct_id }}
93-
run: bash ${script_name} bootstrap_deps
92+
- name: Bootstrap test tools ${{ inputs.distinct_id }}
93+
run: bash ${script_name} update install_test
9494

95-
- name: Bootstrap build ${{ inputs.distinct_id }}
96-
run: bash ${script_name} -bs-a
97-
98-
- name: Host - qBittorrent v5 transition ${{ inputs.distinct_id }}
95+
- name: qBittorrent v5 transition ${{ inputs.distinct_id }}
9996
run: |
100-
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" ]]; then
97+
if [[ -f "${qbt_build_dir}/release_info/disable-qt5" || -f "disable-qt5" ]]; then
10198
printf '%s\n' "disable_qt5=yes" >> $GITHUB_ENV
10299
printf '%s\n' "Found file: \`disable-qt5\` -> setting env: \`disable_qt5=yes\`" >> $GITHUB_STEP_SUMMARY
103100
fi
104101
102+
- name: Bootstrap core deps ${{ inputs.distinct_id }}
103+
if: env.disable_qt5 != 'yes'
104+
run: bash ${script_name} install_core
105+
106+
- name: Bootstrap build ${{ inputs.distinct_id }}
107+
if: env.disable_qt5 != 'yes'
108+
run: bash ${script_name} -bs-a
109+
105110
- name: glibc ${{ inputs.distinct_id }}
106111
if: env.disable_qt5 != 'yes'
107112
run: bash ${script_name} glibc

.github/workflows/ci-main-reusable-caller.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ on:
5656
type: choice
5757
options: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
5858

59-
concurrency:
60-
group: ${{ github.workflow }}
61-
cancel-in-progress: true
62-
6359
permissions: {}
6460

6561
jobs:
6662
ci-debian-build:
67-
if: always() && github.event.inputs.debian-build == 'true'
63+
if: github.event.inputs.debian-build == 'true'
6864
concurrency:
6965
group: ci-debian-build
7066
cancel-in-progress: true
@@ -79,7 +75,7 @@ jobs:
7975
script_name: ${{ github.event.inputs.script_name }}
8076

8177
ci-alpine-build:
82-
if: always() && github.event.inputs.alpine-build == 'true'
78+
if: github.event.inputs.alpine-build == 'true'
8379
concurrency:
8480
group: ci-alpine-build
8581
cancel-in-progress: true
@@ -97,7 +93,7 @@ jobs:
9793

9894
ci-alpine-release:
9995
needs: [ci-alpine-build]
100-
if: always() && github.event.inputs.release == 'true' && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
96+
if: github.event.inputs.release == 'true' && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
10197
concurrency:
10298
group: ci-alpine-release
10399
cancel-in-progress: true
@@ -115,7 +111,7 @@ jobs:
115111
cancel-in-progress: true
116112
permissions:
117113
actions: write
118-
runs-on: ubuntu-24.04
114+
runs-on: ubuntu-24.04-arm
119115
env:
120116
GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}"
121117
github_repo: "" # To use ci-auto-rerun-failed-jobs.yml hosted in a remote repository else default to the current repository. Requires PAT token AUTO_RERUN

0 commit comments

Comments
 (0)