|
| 1 | +name: Build and Test DCE |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ sikabo_master ] |
| 6 | + pull_request: |
| 7 | + branches: [ sikabo_master ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + NS3_VER: "3.46" |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Build on ${{ matrix.distro }} |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + include: |
| 21 | + - distro: ubuntu-22.04 |
| 22 | + image: ubuntu:22.04 |
| 23 | + - distro: ubuntu-24.04 |
| 24 | + image: ubuntu:24.04 |
| 25 | + - distro: debian-trixie |
| 26 | + image: debian:trixie |
| 27 | + container: |
| 28 | + image: ${{ matrix.image }} |
| 29 | + steps: |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + export DEBIAN_FRONTEND=noninteractive |
| 33 | + apt-get update |
| 34 | + apt-get install -y \ |
| 35 | + git \ |
| 36 | + gcc \ |
| 37 | + g++ \ |
| 38 | + python3 \ |
| 39 | + python3-dev \ |
| 40 | + cmake \ |
| 41 | + ninja-build \ |
| 42 | + pkg-config \ |
| 43 | + libgsl-dev \ |
| 44 | + libsqlite3-dev \ |
| 45 | + libxml2-dev \ |
| 46 | + wget \ |
| 47 | + make |
| 48 | +
|
| 49 | + - name: Configure git safe directory |
| 50 | + run: git config --global --add safe.directory "$GITHUB_WORKSPACE/ns-3-dce" |
| 51 | + |
| 52 | + - name: Checkout DCE repository |
| 53 | + uses: actions/checkout@v4 |
| 54 | + with: |
| 55 | + path: ns-3-dce |
| 56 | + |
| 57 | + - name: Cache NS-3 build |
| 58 | + id: cache-ns3 |
| 59 | + uses: actions/cache@v4 |
| 60 | + with: |
| 61 | + path: build/ |
| 62 | + key: ns3-${{ env.NS3_VER }}-${{ matrix.distro }} |
| 63 | + restore-keys: | |
| 64 | + ns3-${{ env.NS3_VER }}-${{ matrix.distro }} |
| 65 | +
|
| 66 | + - name: Clone NS-3 |
| 67 | + if: steps.cache-ns3.outputs.cache-hit != 'true' |
| 68 | + run: | |
| 69 | + git clone --branch "ns-${{ env.NS3_VER }}" --depth 1 \ |
| 70 | + https://gitlab.com/nsnam/ns-3-dev.git "ns-${{ env.NS3_VER }}" |
| 71 | +
|
| 72 | + - name: Configure NS-3 |
| 73 | + if: steps.cache-ns3.outputs.cache-hit != 'true' |
| 74 | + working-directory: ns-${{ env.NS3_VER }} |
| 75 | + run: | |
| 76 | + ./ns3 configure \ |
| 77 | + --disable-werror \ |
| 78 | + --prefix="$GITHUB_WORKSPACE/build" \ |
| 79 | + --build-profile=release |
| 80 | +
|
| 81 | + - name: Build NS-3 |
| 82 | + if: steps.cache-ns3.outputs.cache-hit != 'true' |
| 83 | + working-directory: ns-${{ env.NS3_VER }} |
| 84 | + run: ./ns3 build |
| 85 | + |
| 86 | + - name: Install NS-3 |
| 87 | + if: steps.cache-ns3.outputs.cache-hit != 'true' |
| 88 | + working-directory: ns-${{ env.NS3_VER }} |
| 89 | + run: ./ns3 install |
| 90 | + |
| 91 | + - name: Configure DCE |
| 92 | + working-directory: ns-3-dce |
| 93 | + run: | |
| 94 | + ./waf configure \ |
| 95 | + --with-ns3="$GITHUB_WORKSPACE/build" \ |
| 96 | + --prefix="$GITHUB_WORKSPACE/build" \ |
| 97 | + --enable-opt |
| 98 | +
|
| 99 | + - name: Build DCE |
| 100 | + working-directory: ns-3-dce |
| 101 | + run: ./waf build |
| 102 | + |
| 103 | + - name: Run DCE test (dce-mt2) |
| 104 | + working-directory: ns-3-dce |
| 105 | + env: |
| 106 | + LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib:${{ github.workspace }}/build/lib64 |
| 107 | + DCE_PATH: ${{ github.workspace }}/ns-3-dce/myscripts/mt2 |
| 108 | + run: ./waf --run "dce-mt2" |
0 commit comments