Skip to content

Commit

Permalink
tc
Browse files Browse the repository at this point in the history
  • Loading branch information
msune committed Sep 29, 2024
1 parent 2816b71 commit 48e4791
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
PLATFORMS: linux/amd64
PLATFORMS: "linux/amd64 linux/arm64"

permissions:
packages: write
Expand All @@ -18,10 +18,11 @@ jobs:
matrix:
combination:
#Debug
- { kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '1' }

- { arch: 'linux/amd64', kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '1' }
- { arch: 'linux/arm64', kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '1' }
#NDEBUG
- { kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '0' }
- { arch: 'linux/amd64', kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '0' }
- { arch: 'linux/arm64', kernel: 'Linux 6.8', runner: 'ubuntu-24.04', clangs: 'clang-14 clang-15 clang-16 clang-17 clang-18', debug: '0' }
runs-on: ${{ matrix.combination.runner }}
steps:
- name: "Checkout sfunnel"
Expand All @@ -31,35 +32,45 @@ jobs:
fetch-depth: 0
fetch-tags: 1

- name: Set up QEMU for ARM64
if: matrix.combination.arch == 'linux/arm64'
uses: docker/setup-qemu-action@v2
with:
platforms: ${{matrix.combination.arch}}

- name: Set up QMEU run environment if not amd64
if: matrix.combination.arch == 'linux/arm64'
run: |
docker run --name test --platform linux/arm64 -d arm64v8/ubuntu bash -c "sleep infinity"
echo "QEMU_ENV=docker exec $(env | tr "\n" " " | sed 's/ \(\w*\)=/ -e \1=/g') test bash -c " >> $GITHUB_ENV
docker exec test bash -c "apt-get update && apt-get install -y sudo software-properties-common"
- name: "Install deps..."
run: |
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install -y ${{matrix.combination.clangs}} make iproute2 \
$QEMU_ENV sudo add-apt-repository universe
$QEMU_ENV sudo apt-get update
$QEMU_ENV sudo apt-get install -y ${{matrix.combination.clangs}} make iproute2 \
bridge-utils python3-scapy python3-pip libbpf-dev \
libelf-dev linux-headers-generic \
linux-libc-dev llvm iptables
sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
if [[ "${{ matrix.combination.runner }}" == "ubuntu-24.04" ]]; then
sudo apt-get install python3-pytest
else
sudo pip3 install pytest #pytest binary missing in python3-pytest
fi
$QEMU_ENV sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
$QEMU_ENV sudo apt-get install -y python3-pytest
- name: "Allow test traffic in iptables/nftables"
run: |
sudo iptables -L -n
sudo iptables -t nat -L -n
sudo iptables -I FORWARD -s 11.1.1.1 -j ACCEPT
$QEMU_ENV sudo iptables -L -n
$QEMU_ENV sudo iptables -t nat -L -n
$QEMU_ENV sudo iptables -I FORWARD -s 11.1.1.1 -j ACCEPT
- name: "Run tests on '${{matrix.combination.clangs}}'..."
run: |
cd sfunnel/test
for clang in ${{matrix.combination.clangs}}; do
echo "[${clang}] Running tests ..."
make VERBOSE=1 CLANG=${clang} DEBUG=${{matrix.combination.debug}} || ( echo "FAILED: test failed with '${clang}' debug='${{matrix.combination.debug}}'" && exit 1 )
make clean 2>&1 > /dev/null
echo "[${clang}]"
done
$QEMU_ENV cd sfunnel/test; \
for clang in ${{matrix.combination.clangs}}; do \
echo \"[${clang}] Running tests ...\"; \
make VERBOSE=1 CLANG=${clang} DEBUG=${{matrix.combination.debug}} || ( echo \"FAILED: test failed with '${clang}' debug='${{matrix.combination.debug}}'\" && exit 1 );\
make clean 2>&1 > /dev/null; \
echo \"[${clang}]\"; \
done
docker_build_test_publish:
needs: [make_check]
Expand Down

0 comments on commit 48e4791

Please sign in to comment.