From 7931c492daa782ead9a881fcbdc40fc4de3dbeaf Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 28 Apr 2024 13:03:59 +0200 Subject: [PATCH] Introduce Github Actions CI workflow Introduce Github Actions CI workflow to compile test Pull Request and push. Add simple build test on Windows and advanced test with various compile option for Ubuntu. Signed-off-by: Christian Marangi --- .github/workflows/build.yml | 131 ++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..16ca28cf66 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,131 @@ +name: Build +on: + push: + pull_request: + +jobs: + # build-windows: + # name: Build Windows + # runs-on: windows-latest + + # steps: + # - name: Add msbuild to PATH + # uses: microsoft/setup-msbuild@v2 + + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # path: nmap + + # - name: Checkout mswin32-aux + # run: svn checkout https://svn.nmap.org/nmap-mswin32-aux + + # - name: Prepare pcre2 + # working-directory: nmap\mswin32 + # run: | + # mkdir build-pcre2 + # cd build-pcre2 + # cmake.exe -A Win32 ..\..\libpcre\ + + # - name: Build + # working-directory: nmap\mswin32 + # run: | + # msbuild nmap.sln /p:Configuration="Release" + + build-macos: + name: Build Macos + runs-on: macos-latest + + steps: + + - name: Install Deps + run: | + ls /opt/homebrew/opt/openssl@3 + # Use MacOS python instead of brew variant + brew unlink python + + pip install build setuptools + + - name: Checkout + uses: actions/checkout@v4 + with: + path: nmap + + - name: Configure + working-directory: nmap + run: | + # which python3 + # python3 --version + # /opt/homebrew/bin/python3 --version + + # which -a pip + # which -a python + # which python + # python --version + + # echo $PATH + + # export PATH="/opt/homebrew/bin:$PATH" + + # echo $PATH + + # cd /opt/homebrew/bin/ + # ln -s python3 python + + # which python + # python --version + # which python3 + # python3 --version + # which python3.12 + + + + # /opt/homebrew/bin/python3.12 -c "import build" + + # ./configure --with-openssl="/opt/homebrew/include/" + ./configure + + - name: Build + working-directory: nmap + run: make + + # build-ubuntu: + # name: Build Ubuntu + # runs-on: ubuntu-latest + + # strategy: + # matrix: + # config: + # - "--without-openssl" + # - "--without-libssh2" + # - "--without-liblua" + # - "--without-zenmap" + # - "--without-ndiff" + # - "--with-nping" + # - "--with-ncat" + + # steps: + # - name: Install Deps + # run: | + # sudo apt install python3-build + + # # python3-build installed from apt is currently broken + # # Workaround is to just update it + # # + # # Can be dropped eventually once it's correctly handled. + # python3 -m pip install --upgrade build + + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Configure + # run: ./configure ${{ matrix.config }} + + # - name: Build + # run: make + + # - name: Check + # run: make check + + # - name: Install + # run: sudo make install