5 Commits

Author SHA1 Message Date
remittor
61f33e4c33 proxy: Delete tpws, mdig, ip2set packages 2026-01-01 17:06:01 +03:00
remittor
0a66ad1f3a build: Add step "Download sources (dl)" 2026-01-01 16:48:14 +03:00
remittor
e67a3d001b build: Add new option "Use cache for host tools'" 2026-01-01 15:50:28 +03:00
remittor
b01b370c51 build: Fix key of cache 2026-01-01 12:43:21 +03:00
remittor
75542fe301 build: Fix cache steps 2026-01-01 11:44:10 +03:00
2 changed files with 55 additions and 55 deletions

View File

@@ -3,6 +3,14 @@ name: build
on:
workflow_dispatch:
inputs:
use_cache:
description: 'Use cache for host tools'
required: true
default: 'false'
type: choice
options:
- true
- false
first_kernel_compile:
description: 'First kernel compile'
required: true
@@ -12,7 +20,7 @@ on:
- true
- false
test_build:
description: 'Test build'
description: 'Test build (only spec target) '
required: true
default: 'false'
type: choice
@@ -20,12 +28,12 @@ on:
- true
- false
target_name:
description: 'Target Name'
description: 'Target Name for test build'
required: false
default: 'r3d'
type: string
package_dir:
description: 'Package Dir'
description: 'Package Dir for test build'
required: false
default: ''
type: string
@@ -171,7 +179,7 @@ jobs:
sudo apt-get -qq update
#sudo apt-get -qq update && sudo apt-get -qq upgrade
sudo apt-get -qq install build-essential gawk flex rsync swig unzip zlib1g-dev file wget
sudo apt-get -qq install libc6-dev clang flex bison g++ gcc-multilib g++-multilib
sudo apt-get -qq install libc6-dev clang bison g++ gcc-multilib g++-multilib
sudo apt-get -qq install gettext git libncurses5-dev libssl-dev python3-setuptools
sudo apt-get -qq install libc6-dev pkg-config
sudo apt-get -qq autoremove --purge
@@ -213,10 +221,26 @@ jobs:
- name: Update OpenWrt packages
id: update
env:
USE_CACHE: ${{ github.event.inputs.use_cache }}
run: |
./xupdate.sh -f
mkdir -p logs
echo "status=success" >> $GITHUB_OUTPUT
echo "USE_CACHE=$USE_CACHE" >> $GITHUB_ENV
if [ "$USE_CACHE" = "true" ]; then
rm -rf staging_dir/
mkdir -p staging_dir/host
fi
- name: Restore cache for host tools
id: tools_cache_restore
if: github.event.inputs.use_cache == 'true'
uses: actions/cache/restore@v4
with:
key: host-tools-${{ runner.os }}-${{ needs.check.outputs.fw_ver }}-${{ hashFiles('tools/**') }}
path: |
staging_dir/host
- name: Configure
id: configure
@@ -256,50 +280,6 @@ jobs:
cat .config
echo "========================"
- name: Prepare for use cache of tools and toolchain
run: |
echo "G_TARGET_ARCH = $G_TARGET_ARCH"
mkdir -p staging_dir/host
rm -rf /tmp/staging-host
mkdir -p /tmp/staging-host
cp -a staging_dir/host/* /tmp/staging-host/
rm -rf staging_dir/host/*
- name: Cache host tools
uses: actions/cache@v4
with:
path: staging_dir/host
key: host-tools-${{ runner.os }}-${{ hashFiles('tools/**') }}
save-always: true
restore-keys: |
host-tools-${{ runner.os }}-
- name: Cache toolchain
if: false
uses: actions/cache@v4
with:
path: staging_dir/toolchain-*
key: toolchain-${{ env.G_TARGET_ARCH }}-${{ hashFiles('toolchain/**') }}
save-always: true
restore-keys: |
toolchain-${{ env.G_TARGET_ARCH }}-
- name: Restore saved host staging
run: |
cp -af /tmp/staging-host/* staging_dir/host
rm -rf /tmp/staging-host
- name: Increase swap to 16G
if: false
run: |
free -h
sudo swapoff -a || true
sudo rm -f /swapfile
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
- name: Monitor memory
run: |
echo "CPU cores = $(nproc)"
@@ -311,6 +291,13 @@ jobs:
echo "Available storage:"
sudo df -h
- name: Download sources (dl)
id: download
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
run: |
make -j$(nproc) download
echo "status=success" >> $GITHUB_OUTPUT
- name: Build tools and toolchain
id: tools
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
@@ -318,6 +305,24 @@ jobs:
make toolchain/install -j$(nproc)
echo "status=success" >> $GITHUB_OUTPUT
- name: Save cache for host tools (use_cache = true)
id: tools_cache_save
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.tools_cache_restore.outputs.cache-primary-key }}
path: |
staging_dir/host
- name: Save cache for host tools (use_cache = false)
id: tools_cache_save_2
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache != 'true'
uses: actions/cache/save@v4
with:
key: host-tools-${{ runner.os }}-${{ needs.check.outputs.fw_ver }}-${{ hashFiles('tools/**') }}
path: |
staging_dir/host
- name: Kernel compile
id: kernel
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.first_kernel_compile == 'true' && github.event.inputs.fake_build != 'true' }}
@@ -348,9 +353,9 @@ jobs:
fi
if [ "$FAKE_BUILD" != "true" ]; then
if [ "$TEST_BUILD" != "true" ]; then
make -j$(nproc) download world
make -j$(nproc) world
else
make V=sc download world
make V=sc world
fi
fi
# process results

View File

@@ -9,12 +9,7 @@ CONFIG_PACKAGE_luci-i18n-https-dns-proxy-ru=y
CONFIG_PACKAGE_igmpproxy=y
CONFIG_PACKAGE_zapret=y
CONFIG_PACKAGE_zapret-tpws=y
CONFIG_PACKAGE_zapret-mdig=y
CONFIG_PACKAGE_zapret-ip2net=y
CONFIG_PACKAGE_luci-app-zapret=y
CONFIG_PACKAGE_zapret2=y
CONFIG_PACKAGE_zapret2-mdig=y
CONFIG_PACKAGE_zapret2-ip2net=y
CONFIG_PACKAGE_luci-app-zapret2=y