Skip to content

Update Windows build to build with npcap so networking should work #71

Update Windows build to build with npcap so networking should work

Update Windows build to build with npcap so networking should work #71

name: Build, run test and upload binaries
on: [push, pull_request]
jobs:
linux-x86-clang:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-x86-clang-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
linux-x86-gcc:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-x86-gcc-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
linux-arm-gcc-crosscompile:
runs-on: "ubuntu-20.04"
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install netcat-openbsd qemu-user-binfmt qemu-user g++-multilib-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DSTATIC_COMPILE=yes -DDISABLE_PCAP=yes -DDISABLE_SDL=yes -DDISABLE_X11=yes -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall" -DCMAKE_C_COMPILER="arm-linux-gnueabihf-gcc-9" -DCMAKE_CXX_COMPILER="arm-linux-gnueabihf-g++-9" -DCMAKE_CXX_FLAGS="-O3 -march=armv7ve"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Binary info
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: file ${{runner.workspace}}/build/axpbox
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-ARM-gcc-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
windows-x86-msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Create npcap sdk folder
working-directory: ${{runner.workspace}}\
run: mkdir pcap
- name: Download npcap sdk
working-directory: ${{runner.workspace}}\pcap
run: curl -o ./npcap-sdk-1.13.zip https://npcap.com/dist/npcap-sdk-1.13.zip
- name: unzip npcap sdk
working-directory: ${{runner.workspace}}\pcap
run: unzip npcap-sdk-1.13.zip
- name: Get current date
id: date
run: echo "name=date::$(date +'%Y-%m-%dT%H%M')" >> $GITHUB_OUTPUT
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}\build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DPCAP_INCLUDE_DIR="${{runner.workspace}}/pcap/Include/" -DPCAP_LIBRARY="${{runner.workspace}}/pcap/Lib/x64/wpcap.lib"
- name: Build
working-directory: ${{runner.workspace}}\build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Test run
working-directory: ${{runner.workspace}}\build
run: ${{runner.workspace}}\build\Release\axpbox.exe
- name: install netcat
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install netcat
- name: Run rom tests script
working-directory: ${{runner.workspace}}\axpbox\test\rom\
run: ${{runner.workspace}}\axpbox\test\rom\test.ps1
- name: Upload AXPbox Binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-windows-x86-msvc-${{ env.BUILD_DATE }}.exe
path: ${{runner.workspace}}\build\Release\axpbox.exe
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
osx-x86-appleclang:
runs-on: "macos-12"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Install dependencies
run: brew install libpcap netcat gnu-sed # sdl2 libx11 / sdl doesnt work see #44
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -std=c++11 -stdlib=libc++ -I/usr/local/opt/libpcap/include"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Upload AXPbox Binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-osx-x86-12-appleclang-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}