Skip to content

Commit d577919

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents fa927f6 + 7ca5813 commit d577919

File tree

3,359 files changed

+45985
-34180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,359 files changed

+45985
-34180
lines changed

.github/actions/zram/action.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: zram
2+
description: Enable zram module on GitHub hosted runner
3+
inputs:
4+
algorithm:
5+
description: The compression algorithm to use with zram
6+
default: zstd
7+
size:
8+
description: Maximum amount of memory to store in compressed form
9+
default: 16G
10+
priority:
11+
description: Priority of swap device (0-32767)
12+
default: '100'
13+
device_name:
14+
description: Name of swap device
15+
default: '/dev/zram0'
16+
runs:
17+
using: composite
18+
steps:
19+
- name: Extract VM kernel version for module compilation
20+
id: kernel-info
21+
shell: bash
22+
run: |
23+
set -euo pipefail
24+
KERNEL_VERSION="$(uname -r | grep -o "^[0-9\\.]*")"
25+
TAR_KERNEL_VERSION="${KERNEL_VERSION%\.0}"
26+
27+
echo "kernel_version=${KERNEL_VERSION}" >> "$GITHUB_OUTPUT"
28+
echo "tar_version=${TAR_KERNEL_VERSION}" >> "$GITHUB_OUTPUT"
29+
echo "modules_dir=/lib/modules/$(uname -r)" >> "$GITHUB_OUTPUT"
30+
31+
- name: Restore cached zram kernel module
32+
id: cache-zram
33+
uses: actions/cache/restore@v5
34+
with:
35+
path: scripts/zram.ko.zst
36+
key: ${{ steps.kernel-info.outputs.kernel_version }}-${{ hashFiles('scripts/linux-kernel-signing-keys.gpg') }}-${{ hashFiles('.github/actions/zram/action.yml') }}
37+
38+
- name: Build zram kernel module
39+
if: steps.cache-zram.outputs.cache-hit != 'true'
40+
shell: bash
41+
run: |
42+
set -euo pipefail
43+
KERNEL_VERSION=${{ steps.kernel-info.outputs.kernel_version }}
44+
TAR_KERNEL_VERSION=${{ steps.kernel-info.outputs.tar_version }}
45+
MODULES_DIR=${{ steps.kernel-info.outputs.modules_dir }}
46+
47+
LINUX_CHECKOUT_DIR=$(mktemp -d)
48+
cd "$LINUX_CHECKOUT_DIR"
49+
curl -OL "https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%\.*}.x/linux-${TAR_KERNEL_VERSION}.tar.xz"
50+
curl -OL "https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%\.*}.x/linux-${TAR_KERNEL_VERSION}.tar.sign"
51+
52+
gpg --import ${{ github.workspace }}/scripts/linux-kernel-signing-keys.gpg
53+
unxz "linux-${TAR_KERNEL_VERSION}.tar.xz"
54+
gpg --verify "linux-${TAR_KERNEL_VERSION}.tar.sign"
55+
tar --extract -f "linux-${TAR_KERNEL_VERSION}.tar"
56+
cd "linux-${TAR_KERNEL_VERSION}/"
57+
58+
# We are basically doing a out-of-tree build for a module which is in-tree
59+
# See docs: https://www.kernel.org/doc/html/latest/kbuild/modules.html
60+
cd drivers/block/zram/
61+
make -C "${MODULES_DIR}/build/" M="$PWD" -j$(nproc)
62+
zstd zram.ko
63+
# Copy back compiled module into scripts/ as actions/cache doesn't support absolute paths:
64+
# See https://github.com/actions/cache/issues/1540
65+
# Additionally restoring cache in /lib/modules/ would require running actions/cache/restore as root
66+
cp zram.ko.zst ${{ github.workspace }}/scripts/
67+
rm -r "$LINUX_CHECKOUT_DIR"
68+
69+
- name: Enable zram kernel module
70+
shell: bash
71+
run: |
72+
set -euo pipefail
73+
sudo cp scripts/zram.ko.zst ${{ steps.kernel-info.outputs.modules_dir }}/kernel/
74+
sudo depmod
75+
sudo modprobe zram
76+
sudo zramctl ${{ inputs.device_name }} --algorithm ${{ inputs.algorithm }} --size ${{ inputs.size }}
77+
sudo mkswap -U clear ${{ inputs.device_name }}
78+
sudo swapon --discard --priority ${{ inputs.priority }} ${{ inputs.device_name }}
79+
80+
- name: Save built zram kernel module
81+
if: steps.cache-zram.outputs.cache-hit != 'true'
82+
uses: actions/cache/save@v5
83+
with:
84+
path: scripts/zram.ko.zst
85+
key: ${{ steps.cache-zram.outputs.cache-primary-key }}

.github/workflows/bootstrap_archives.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
build:
1616
permissions:
1717
contents: read # actions/upload-artifact doesn't need contents: write
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-slim
1919
strategy:
2020
matrix:
2121
arch:
@@ -25,26 +25,26 @@ jobs:
2525
if: github.repository == 'termux-play-store/termux-packages'
2626
steps:
2727
- name: Git clone
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
- name: Create bootstrap archive
3030
run: ./scripts/generate-bootstraps.sh --architectures ${{ matrix.arch }}
3131
- name: Store artifacts
32-
uses: actions/upload-artifact@v4
32+
uses: actions/upload-artifact@v6
3333
with:
3434
name: bootstrap-archives-${{ matrix.arch }}-${{ github.sha }}
3535
path: "*.zip"
3636
publish:
3737
permissions:
3838
contents: write # for git push
3939
needs: build
40-
runs-on: ubuntu-latest
40+
runs-on: ubuntu-slim
4141
steps:
4242
- name: Git clone
43-
uses: actions/checkout@v5
43+
uses: actions/checkout@v6
4444
with:
4545
fetch-depth: 0
4646
- name: Fetch bootstrap archives
47-
uses: actions/download-artifact@v5
47+
uses: actions/download-artifact@v7
4848
with:
4949
merge-multiple: true
5050
path: ./

.github/workflows/check_repository_health.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ permissions: {} # none
1010
jobs:
1111
check-repository-health:
1212
if: github.repository == 'termux/termux-packages'
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-slim
1414
steps:
1515
- name: Clone repository
16-
uses: actions/checkout@v5
16+
uses: actions/checkout@v6
1717
with:
1818
fetch-depth: 1
1919
- id: generate-apt-packages-list
@@ -25,6 +25,8 @@ jobs:
2525
- name: Check repository health
2626
run: |
2727
set -euo pipefail
28+
# This should not be needed when GitHub runners update to node v25.2.0+
29+
# Ref: https://github.com/nodejs/node/commit/506b79e888
2830
export NODE_OPTIONS="--network-family-autoselection-attempt-timeout=500"
2931
./scripts/check-repository-health.js "${{ steps.generate-apt-packages-list.outputs.OUTPUT_DIR }}" | tee repository-health.txt
3032
- name: Create issue if health check fails
@@ -34,4 +36,18 @@ jobs:
3436
run: |
3537
ISSUE_TITLE="Repository Health Check Failed"
3638
ISSUE_BODY=$(cat repository-health.txt)
39+
# if any previous Repository Health Check Failed issues are open, close them first
40+
while read -r number; do
41+
echo "INFO: Closing issue number: $number"
42+
sleep 5
43+
gh issue close "$number" --reason completed
44+
sleep 5
45+
done < <(
46+
gh issue list \
47+
--limit 99999 \
48+
--label "health-check" \
49+
--state open \
50+
--search "$ISSUE_TITLE in:title type:issue" \
51+
--json number | jq -r '.[] | .number'
52+
)
3753
gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --label "health-check" --assignee "thunder-coding"

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4949
steps:
5050
- name: Checkout repository
51-
uses: actions/checkout@v5
51+
uses: actions/checkout@v6
5252

5353
# Add any setup steps before running the `github/codeql-action/init` action.
5454
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -58,7 +58,7 @@ jobs:
5858

5959
# Initializes the CodeQL tools for scanning.
6060
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@v3
61+
uses: github/codeql-action/init@v4
6262
with:
6363
languages: ${{ matrix.language }}
6464
build-mode: ${{ matrix.build-mode }}
@@ -70,6 +70,6 @@ jobs:
7070
# queries: security-extended,security-and-quality
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v3
73+
uses: github/codeql-action/analyze@v4
7474
with:
7575
category: "/language:${{matrix.language}}"

.github/workflows/command_not_found.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
issues: write
1414
contents: write
1515
if: github.repository == 'termux/termux-packages'
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-slim
1717
steps:
1818
- name: Clone repository
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 1
2222
token: ${{ secrets.TERMUXBOT2_TOKEN }}

.github/workflows/docker_image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: github.repository == 'termux-play-store/termux-packages'
2323
steps:
2424
- name: Clone repository
25-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2626
- name: Build
2727
run: |
2828
cd ./scripts

.github/workflows/golang_validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
steps:
2222
- name: Clone repository
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 0
2626
- name: Set process id limit for 32-bit builds depending on aosp-libs
@@ -35,7 +35,7 @@ jobs:
3535
run: ./scripts/bin/golang-validation "${{ matrix.target_arch }}" || exit 1
3636
- name: Upload report artifact
3737
if: always()
38-
uses: actions/upload-artifact@v4
38+
uses: actions/upload-artifact@v6
3939
with:
4040
name: report-${{ matrix.target_arch }}
4141
path: /tmp/golang-validation-report.txt

.github/workflows/packages.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ jobs:
4040
fail-fast: false
4141
steps:
4242
- name: Clone repository
43-
uses: actions/checkout@v5
43+
uses: actions/checkout@v6
4444
with:
4545
fetch-depth: 1000
4646
- name: Set process id limit for 32-bit builds depending on aosp-libs
4747
run: echo 65535 | sudo tee /proc/sys/kernel/pid_max
48+
4849
- name: Gather build summary
4950
id: build-info
5051
env:
@@ -225,10 +226,21 @@ jobs:
225226
./scripts/lint-packages.sh "${package_recipes[@]}"
226227
fi
227228
229+
- name: Enable zram
230+
if: ${{ steps.build-info.outputs.skip-building != 'true' }}
231+
uses: ./.github/actions/zram
232+
with:
233+
algorithm: zstd
234+
size: 16G
235+
priority: 100
236+
device_name: /dev/zram0
237+
228238
- name: Free additional disk space (if needed)
229239
if: ${{ steps.build-info.outputs.docker-build == 'false' && steps.build-info.outputs.skip-building != 'true' }}
230240
run: |
231241
./scripts/setup-ubuntu.sh
242+
# need to unset these for setup-android-sdk.sh.
243+
unset NDK ANDROID_HOME
232244
./scripts/setup-android-sdk.sh
233245
rm -f ${HOME}/lib/ndk-*.zip ${HOME}/lib/sdk-*.zip
234246
sudo apt install ninja-build
@@ -252,6 +264,11 @@ jobs:
252264
253265
if [[ "${#packages[@]}" -gt 0 ]]; then
254266
if [ "$DOCKER_BUILD" == 'false' ]; then
267+
# these need to be unset a second time again for ./build-package.sh
268+
# when it is run outside of Docker, because GitHub Actions does not
269+
# support permanently unsetting variables at time of writing.
270+
# https://github.com/actions/runner/issues/1126
271+
unset NDK ANDROID_HOME
255272
./build-package.sh -I -C -a "${{ matrix.target_arch }}" "${packages[@]}"
256273
else
257274
./scripts/run-docker.sh ./build-package.sh -I -C -a "${{ matrix.target_arch }}" "${packages[@]}"
@@ -290,24 +307,24 @@ jobs:
290307
find debs -type f -name "*.deb" -exec sha256sum "{}" \; | sort -k2 | tee checksum-${{ matrix.target_arch }}-${{ github.sha }}.txt
291308
- name: Store checksums for built *.deb files
292309
if: always()
293-
uses: actions/upload-artifact@v4
310+
uses: actions/upload-artifact@v6
294311
with:
295312
name: checksum-${{ matrix.target_arch }}-${{ github.sha }}
296313
path: checksum-${{ matrix.target_arch }}-${{ github.sha }}.txt
297314
- name: Store *.deb files
298315
if: always()
299-
uses: actions/upload-artifact@v4
316+
uses: actions/upload-artifact@v6
300317
with:
301318
name: debs-${{ matrix.target_arch }}-${{ github.sha }}
302319
path: ./artifacts
303320

304321
test-buildorder-random:
305322
permissions:
306323
contents: read
307-
runs-on: ubuntu-latest
324+
runs-on: ubuntu-slim
308325
steps:
309326
- name: Clone repository
310-
uses: actions/checkout@v5
327+
uses: actions/checkout@v6
311328
- name: Randomise buildorder.py test
312329
run: ./scripts/bin/test-buildorder-random
313330
- name: Randomise buildorder.py test (aarch64)

.github/workflows/vagrant.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Clone repository
30-
uses: actions/checkout@v5
30+
uses: actions/checkout@v6
3131
- name: Set up Vagrant repo
3232
run: |
3333
# https://developer.hashicorp.com/vagrant/downloads#linux
@@ -61,7 +61,7 @@ jobs:
6161
# Archiving *.deb files in a tarball to avoid issues with uploading.
6262
tar cf artifacts/debs-${{ github.sha }}.tar debs
6363
- name: Store *.deb files
64-
uses: actions/upload-artifact@v4
64+
uses: actions/upload-artifact@v6
6565
with:
6666
name: debs-${{ github.sha }}
6767
path: ./artifacts

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ checksum*
4343

4444
# Generated by scripts/check-repository-health.sh
4545
scripts/apt-packages-list-*.txt
46+
47+
# Generated on GitHub Actions CI when building kernel modules
48+
/scripts/*.ko.zst

0 commit comments

Comments
 (0)