diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index d5b25d47c..cb8ec11d2 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -172,3 +172,99 @@ jobs: name: macos-amd64-failure path: ${{github.workspace}}/build/ compression-level: 9 # maximum compression + + # ---------------------------------------------------------------------------------------------- + cygwin-amd64: + name: Cygwin (amd64/x86_64) + runs-on: windows-latest + env: + CYGWIN_NOWINPATH: 1 # isolate cygwin from windows + defaults: + run: + shell: C:\cygwin\bin\bash.EXE --login -e -o pipefail -o igncr '{0}' + steps: + - name: Avoid '\r' problems + shell: cmd + run: git config --global core.autocrlf input + + - uses: actions/checkout@v4 + + - name: Install dependencies with Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: git curl p7zip cmake make gcc-core # FIXME using the libelf-devel package gets you a "missing libintl_dgettext" error, how to fix? + platform: x86_64 + add-to-path: false + + - name: Adapt cygwin environment + run: | + set -x + # avoid git error "detected dubious ownership" + git config --global --add safe.directory '*' + # set the start directory + echo "cd '${{github.workspace}}'" >> ~/.bash_profile + + - name: Install dependencies (libelf) + run: | + set -x + curl -O https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz + tar xvzf libelf-0.8.13.tar.gz + cd libelf-0.8.13 + ./configure --host x86_64-pc-cygwin + make + make install + + - name: Install dependencies (winpcap SDK) + run: | + set -x + curl -O https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip + 7za x ./WpdPack_4_1_2.zip -o. + cp ./WpdPack/Lib/x64/Packet.lib /usr/local/lib/libpacket.a + cp ./WpdPack/Lib/x64/wpcap.lib /usr/local/lib/libwpcap.a + cp --verbose --force --recursive ./WpdPack/Include/* /usr/local/include/ + + - name: Install dependencies (win10pcap) + shell: cmd + run: | + echo on + curl -O "http://www.win10pcap.org/download/Win10Pcap-v10.2-5002.msi" + msiexec /i "Win10Pcap-v10.2-5002.msi" /qn /norestart /L*v "Win10Pcap-install.log" + type "Win10Pcap-install.log" + + - name: Configure with CMake + run: cmake -B $(pwd)/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDYNAMIPS_CODE=both -DBUILD_UDP_RECV=ON -DBUILD_UDP_SEND=ON -DCMAKE_INSTALL_PREFIX=$(pwd)/build/install -DCPACK_PACKAGE_FILE_NAME=dynamips-package -DCPACK_GENERATOR=ZIP + + - name: Build + run: cmake --build $(pwd)/build --config ${{env.BUILD_TYPE}} + + - name: Test + run: | + set -x + cd build + ctest --verbose --build-config ${{env.BUILD_TYPE}} + ./stable/dynamips -e + ./unstable/dynamips_amd64_unstable -e + + - name: Install + run: cmake --build $(pwd)/build --config ${{env.BUILD_TYPE}} --target install + + - name: Package + run: cmake --build $(pwd)/build --config ${{env.BUILD_TYPE}} --target package + + - name: Upload success + if: ${{ success() }} + uses: actions/upload-artifact@v4 + with: + name: cygwin-amd64-success + path: | + ${{github.workspace}}/build/install/ + ${{github.workspace}}/build/dynamips-package.zip + compression-level: 9 # maximum compression + + - name: Upload failure + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: cygwin-amd64-failure + path: ${{github.workspace}}/build/ + compression-level: 9 # maximum compression