chore: test debug build #269
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenWRT Package | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
branches: | |
- master | |
workflow_dispatch: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
release: | |
types: | |
- created | |
jobs: | |
test: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-fast install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev | |
- name: Build and install libubox | |
working-directory: /tmp | |
run: | | |
git clone https://github.com/openwrt/libubox.git | |
cd libubox | |
mkdir build | |
cd build | |
cmake .. -DBUILD_LUA=OFF -DBUILD_EXAMPLES=OFF | |
make | |
sudo make install | |
- name: Build and install libuci | |
working-directory: /tmp | |
run: | | |
git clone https://github.com/openwrt/uci.git | |
cd uci | |
mkdir build | |
cd build | |
cmake .. -DBUILD_LUA=OFF | |
make | |
sudo make install | |
- name: Run unit tests | |
run: | | |
cmake -S . -B build -DUA2F_BUILD_TESTS=ON | |
cmake --build build | |
./build/ua2f_test | |
test-standalone: | |
name: Run unit tests without uci support | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-fast install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev | |
- name: Run unit tests | |
run: | | |
cmake -S . -B build -DUA2F_BUILD_TESTS=ON -DUA2F_ENABLE_UCI=OFF | |
cmake --build build | |
./build/ua2f_test | |
test-integration: | |
name: Run integration tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
cache: [ "-DUA2F_NO_CACHE=ON", "-DUA2F_NO_CACHE=OFF" ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-fast install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install requirements | |
run: | | |
sudo pip install -r scripts/requirements.txt | |
- name: Enable ipv6 | |
uses: fscarmen/warp-on-actions@v1.3 | |
with: | |
stack: dual | |
mode: client | |
- name: Configure ipv6 | |
run: | | |
echo "net.ipv6.conf.all.disable_ipv6=0" | sudo tee -a /etc/sysctl.conf | |
echo "net.ipv6.conf.default.disable_ipv6=0" | sudo tee -a /etc/sysctl.conf | |
echo "net.ipv6.conf.lo.disable_ipv6=0" | sudo tee -a /etc/sysctl.conf | |
sudo sysctl -p | |
- name: Debug IPv6 | |
run: | | |
ip -6 addr | |
sysctl net.ipv6.conf.all.disable_ipv6 | |
sysctl net.ipv6.conf.default.disable_ipv6 | |
sysctl net.ipv6.conf.lo.disable_ipv6 | |
ping6 -c 4 ::1 || echo "::1 is not reachable" | |
- name: Run unit tests | |
run: | | |
cmake -S . -B build -DUA2F_BUILD_TESTS=OFF -DUA2F_ENABLE_UCI=OFF -DUA2F_ENABLE_ASAN=ON ${{ matrix.cache }} | |
cmake --build build | |
./build/ua2f --version | |
sudo python scripts/test.py ./build/ua2f | |
- name: Upload log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: syslog-cache-${{ matrix.cache }} | |
path: /var/log/syslog | |
build: | |
name: Build ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- test-standalone | |
- test-integration | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- aarch64_cortex-a53 | |
- aarch64_cortex-a72 | |
- aarch64_generic | |
- arm_cortex-a7_neon-vfpv4 | |
- arm_cortex-a9_vfpv3-d16 | |
- arm_cortex-a15_neon-vfpv4 | |
- i386_pentium4 | |
- i386_pentium-mmx | |
- mips_24kc | |
- mipsel_24kc | |
- powerpc_464fp | |
- powerpc_8548 | |
- x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
uses: openwrt/gh-action-sdk@v7 | |
env: | |
ARCH: ${{ matrix.arch }}-23.05.5 | |
FEEDNAME: packages_ci | |
PACKAGES: openwrt | |
- name: Move created packages to project dir | |
run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true | |
- name: Store packages | |
uses: actions/upload-artifact@v4 | |
if: "!startsWith(github.ref, 'refs/tags/v')" | |
with: | |
name: ${{ matrix.arch }}-${{ github.sha }}-packages | |
path: "*.ipk" | |
- name: Upload packages | |
uses: svenstaro/upload-release-action@v2 | |
if: "startsWith(github.ref, 'refs/tags/v')" | |
with: | |
repo_token: ${{ github.token }} | |
file: "*.ipk" | |
tag: ${{ github.ref }} | |
file_glob: true | |
- name: Store logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.arch }}-${{ github.sha }}-logs | |
path: logs/ | |
- name: Remove logs | |
run: sudo rm -rf logs/ || true |