From cbd239e1c6c9b7e418e62ca127748c2e03050a3d Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Fri, 2 Aug 2024 09:22:40 +0200 Subject: [PATCH 1/3] ci: add arm64 WIP Meanwhile, even if 1 single OS is used, it could be extended later to run the CI for some other Linux distributions. Frankly, I do not foresee the benefits, but currently, let's keep it has a placeholder. TODO: change the paths of the artifact for the tests to be run. --- .github/workflows/actions-compile.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions-compile.yml b/.github/workflows/actions-compile.yml index 1bfe2b3..85ac6e8 100644 --- a/.github/workflows/actions-compile.yml +++ b/.github/workflows/actions-compile.yml @@ -10,9 +10,11 @@ on: jobs: build-gtp-guard: name: Build gtp-guard - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ ubuntu-latest ] + arch: [x86_64, arm64] compiler: [ gcc, clang ] steps: - name: add missing packages @@ -30,14 +32,19 @@ jobs: - name: Upload gtp-guard artifacts uses: actions/upload-artifact@v4 with: - name : artifact-gtp-guard-${{ matrix.compiler }} + name : artifact-gtp-guard-${{ matrix.compiler }}-${{ matrix.arch }} path : | bin/gtp-guard src/bpf/*.bpf + bin/*.bpf test/ build-gtping: name: Build gtping - runs-on: ubuntu-latest + runs-on: $${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + arch: [x86_64, arm64] needs: build-gtp-guard steps: - name: gtping from upstream @@ -59,7 +66,11 @@ jobs: test-using-gtping: name: gtp-guard test using gtping needs: build-gtping - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + arch: [x86_64, arm64] steps: - name: add missing packages uses: ConorMacBride/install-package@v1 From d40a614f961ba9cc972f5da1693a2850c74c3ebb Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Fri, 2 Aug 2024 09:40:40 +0200 Subject: [PATCH 2/3] ci: arm64 Test should be run with each respective target build. --- .github/workflows/actions-compile.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/actions-compile.yml b/.github/workflows/actions-compile.yml index 85ac6e8..e07400f 100644 --- a/.github/workflows/actions-compile.yml +++ b/.github/workflows/actions-compile.yml @@ -100,17 +100,18 @@ jobs: - name: run the test shell: bash run : | + APATH="bin/artifact-gtp-guard-${{ matrix.compiler }}-${{ matrix.arch }}" ls -R -la - chmod 755 bin/artifact-gtp-guard-gcc/bin/gtp-guard + chmod 755 $APATH/bin/gtp-guard chmod 755 bin/artifact-gtping/gtping - chmod 755 bin/artifact-gtp-guard-gcc/test/testenv.sh - chmod 755 bin/artifact-gtp-guard-gcc/test/gtpu-ping.py - sudo bin/artifact-gtp-guard-gcc/test/testenv.sh \ + chmod 755 $APATH/test/testenv.sh + chmod 755 $PATH/test/gtpu-ping.py + sudo $APATH/test/testenv.sh \ -i bin/artifact-gtping/gtping \ - -u bin/artifact-gtp-guard-gcc/test/gtpu-ping.py \ - -g bin/artifact-gtp-guard-gcc/bin/gtp-guard \ + -u $APATH/test/gtpu-ping.py \ + -g $APATH/bin/gtp-guard \ -c etc/gtp-guard.conf \ - -f bin/artifact-gtp-guard-gcc/bin/gtp_fwd.bpf \ - -r bin/artifact-gtp-guard-gcc/bin/gtp_route.bpf \ - -m bin/artifact-gtp-guard-gcc/bin/gtp_mirror.bpf \ + -f $APATH/bin/gtp_fwd.bpf \ + -r $APATH/bin/gtp_route.bpf \ + -m $APATH/bin/gtp_mirror.bpf \ -k no From 3d5bdc89c305ec9492d9c837c79c58a8cfaebdb1 Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Fri, 2 Aug 2024 09:46:35 +0200 Subject: [PATCH 3/3] ci: arm64 for gtping tests Using artifact paths for gtping too --- .github/workflows/actions-compile.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions-compile.yml b/.github/workflows/actions-compile.yml index e07400f..21a2c78 100644 --- a/.github/workflows/actions-compile.yml +++ b/.github/workflows/actions-compile.yml @@ -40,7 +40,7 @@ jobs: test/ build-gtping: name: Build gtping - runs-on: $${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest ] @@ -61,7 +61,7 @@ jobs: - name: Upload gtping artifacts uses: actions/upload-artifact@v4 with: - name : artifact-gtping + name : artifact-gtping-${{ matrix.arch }} path : src/gtping test-using-gtping: name: gtp-guard test using gtping @@ -71,6 +71,7 @@ jobs: matrix: os: [ ubuntu-latest ] arch: [x86_64, arm64] + compiler: [ gcc, clang ] steps: - name: add missing packages uses: ConorMacBride/install-package@v1 @@ -101,13 +102,14 @@ jobs: shell: bash run : | APATH="bin/artifact-gtp-guard-${{ matrix.compiler }}-${{ matrix.arch }}" + APING="bin/artifact-gtping-${{ matrix.arch }}" ls -R -la chmod 755 $APATH/bin/gtp-guard - chmod 755 bin/artifact-gtping/gtping + chmod 755 $APING/gtping chmod 755 $APATH/test/testenv.sh - chmod 755 $PATH/test/gtpu-ping.py + chmod 755 $APATH/test/gtpu-ping.py sudo $APATH/test/testenv.sh \ - -i bin/artifact-gtping/gtping \ + -i $APING/gtping \ -u $APATH/test/gtpu-ping.py \ -g $APATH/bin/gtp-guard \ -c etc/gtp-guard.conf \