revert: ipv6 is impossible for github actions #250
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: [true, false] | |
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: Run unit tests | |
run: | | |
cmake -S . -B build -DUA2F_BUILD_TESTS=OFF -DUA2F_ENABLE_UCI=OFF -DUA2F_ENABLE_ASAN=ON ${{ matrix.cache == 'false' && '-DUA2F_NO_CACHE=ON' || '-DUA2F_NO_CACHE=OFF' }} | |
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: | |
include: | |
- arch: aarch64_cortex-a53 | |
target: mvebu-cortexa53 | |
- arch: aarch64_cortex-a72 | |
target: mvebu-cortexa72 | |
- arch: aarch64_generic | |
target: rockchip-armv8 | |
- arch: arm_cortex-a7_neon-vfpv4 | |
target: ipq40xx-generic | |
- arch: arm_cortex-a9_vfpv3-d16 | |
target: mvebu-cortexa9 | |
- arch: arm_cortex-a15_neon-vfpv4 | |
target: armvirt-32 | |
- arch: i386_pentium4 | |
target: x86-generic | |
- arch: i386_pentium-mmx | |
target: x86-geode | |
- arch: mips_24kc | |
target: ath79-generic | |
- arch: mipsel_24kc | |
target: mt7621 | |
- arch: powerpc_464fp | |
target: apm821xx-nand | |
- arch: powerpc_8548 | |
target: mpc85xx-p1010 | |
- arch: x86_64 | |
target: x86-64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
uses: openwrt/gh-action-sdk@v7 | |
env: | |
ARCH: ${{ matrix.arch }} | |
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 |