diff --git a/.ci_scripts/cross-compile/translate_and_build.sh b/.ci_scripts/cross-compile/translate_and_build.sh deleted file mode 100755 index 5552ab3dc4234392dad53dd8ba1351964506948b..0000000000000000000000000000000000000000 --- a/.ci_scripts/cross-compile/translate_and_build.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -## CONSTANTS -CI_SCRIPTS_DIR="$GITHUB_WORKSPACE/.ci_scripts/test-firewall" - - -## COMMAND LINE ARGUMENTS -MODE="" -ARG="" -while getopts "r:p:" opt; -do - case "${opt}" in - r|p) - # Rate limit / stochastic verdict - MODE="${opt}" - ARG="${OPTARG}" - ;; - *) - # Default: binary verdict (ACCEPT or DROP) - ;; - esac -done -shift $((OPTIND-1)) - - -######## -# MAIN # -######## - -# 1. Translate profiles with given verdict mode -$CI_SCRIPTS_DIR/translate_profiles.sh $MODE $ARG - -# 2. Cross-compile project with CMake -$GITHUB_WORKSPACE/build.sh -d $GITHUB_WORKSPACE -t $GITHUB_WORKSPACE/openwrt/tl-wdr4900.cmake diff --git a/.github/workflows/cross-compile.yml b/.github/workflows/cross-compile.yml index 1e85860bbbbe1e832d3eda88cdeaf97d2b6cb7bd..a24c2f6bfe4909bfc2f4427bb02c49dc2014a951 100644 --- a/.github/workflows/cross-compile.yml +++ b/.github/workflows/cross-compile.yml @@ -4,7 +4,7 @@ on: [push] jobs: - cross-compile: + binary-verdict: runs-on: ubuntu-latest container: fdekeers/openwrt_tl-wdr4900_gha @@ -18,11 +18,44 @@ jobs: - name: Install Python packages run: pip install -r $GITHUB_WORKSPACE/requirements.txt - - name: Translate and build profiles, with binary verdict - run: $GITHUB_WORKSPACE/.ci_scripts/cross-compile/translate_and_build.sh + - name: Translate profiles + run: $GITHUB_WORKSPACE/.ci_scripts/full-test/translate_profiles.sh - - name: Translate and build profiles, with rate limiting verdict - run: $GITHUB_WORKSPACE/.ci_scripts/cross-compile/translate_and_build.sh -r 50 + - name: Run cross-compilation + run: $GITHUB_WORKSPACE/build.sh -d $GITHUB_WORKSPACE -t $GITHUB_WORKSPACE/openwrt/tl-wdr4900.cmake - - name: Translate and build profiles, with stochastic verdict - run: $GITHUB_WORKSPACE/.ci_scripts/cross-compile/translate_and_build.sh -p 0.5 + + rate-limit-verdict: + runs-on: ubuntu-latest + container: fdekeers/openwrt_tl-wdr4900_gha + + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Translate profiles + run: $GITHUB_WORKSPACE/.ci_scripts/full-test/translate_profiles.sh -r 50 + + - name: Run cross-compilation + run: $GITHUB_WORKSPACE/build.sh -d $GITHUB_WORKSPACE -t $GITHUB_WORKSPACE/openwrt/tl-wdr4900.cmake + + + random-verdict: + runs-on: ubuntu-latest + container: fdekeers/openwrt_tl-wdr4900_gha + + steps: + + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Translate profiles + run: $GITHUB_WORKSPACE/.ci_scripts/full-test/translate_profiles.sh -p 0.5 + + - name: Run cross-compilation + run: $GITHUB_WORKSPACE/build.sh -d $GITHUB_WORKSPACE -t $GITHUB_WORKSPACE/openwrt/tl-wdr4900.cmake