diff --git a/.github/workflows/HaxmBuild.yml b/.github/workflows/HaxmBuild.yml new file mode 100644 index 00000000..01b0247e --- /dev/null +++ b/.github/workflows/HaxmBuild.yml @@ -0,0 +1,52 @@ +name: HAXM build on Windows, macOS and Linux + +on: [push, pull_request] + +env: + # Path to the solution file relative to the root of the project. + SOLUTION_FILE_PATH: . + BUILD_CONFIGURATION: Release + +jobs: + my_first_job: + name: Windows build + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1 + - name: Install related pkg + run: | + choco install -y nuget.commandline + choco install -y windowsdriverkit10 + choco install -y windows-sdk-8.1 + - name: Build + run: | + cd platforms/windows + nuget restore + msbuild haxm.sln /p:Configuration="Debug" /p:Platform="Win32" + msbuild haxm.sln /p:Configuration="Debug" /p:Platform="x64" + ./build/tests/x64/Debug/haxm-tests.exe + my_second_job: + name: macOS build + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: macOS build + run: | + brew install nasm + cd platforms/darwin + xcodebuild -configuration Debug -sdk macosx ARCHS=x86_64 + my_third_job: + name: Linux build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Linux build on Ubuntu + shell: bash + run: | + wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_amd64.deb + sudo apt-get install -y dpkg + sudo dpkg -i /tmp/downloads/nasm_2.13.02-0.1_amd64.deb + cd platforms/linux + make diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f83fa3f9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,77 +0,0 @@ -language: c - -matrix: - include: - - name: "haxm-darwin" - os: osx - addons: - homebrew: - packages: - - nasm - update: true - script: - - cd platforms/darwin - - xcodebuild -configuration Debug -sdk macosx - - - name: "haxm-linux" - os: linux - dist: trusty - sudo: false - env: - - CHROOT=trusty_i386 - - CHROOT_DIR=/tmp/chroot/${CHROOT} - before_install: - - sudo apt-get update - - sudo apt-get install -y linux-headers-`uname -r` - - wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_amd64.deb - - sudo apt-get install -y dpkg - - sudo dpkg -i /tmp/downloads/nasm_2.13.02-0.1_amd64.deb - # Cross-compiling to 32-bit Linux - - mkdir -p ${CHROOT_DIR}/haxm - - cp -r . ${CHROOT_DIR}/haxm - - sudo apt-get install -y debootstrap schroot - - | - ( echo "[${CHROOT}]" - echo "type=directory" - echo "directory=${CHROOT_DIR}" - echo "personality=linux32" - echo "users=`id -un`" - echo "root-users=`id -un`" - ) | sudo tee /etc/schroot/chroot.d/${CHROOT}.conf > /dev/null - - sudo debootstrap --variant=buildd --arch=i386 trusty ${CHROOT_DIR} - - schroot -c ${CHROOT} -u root -- sed -i "1p ; 1s| trusty | trusty-updates |" /etc/apt/sources.list - - schroot -c ${CHROOT} -u root -- apt update - - schroot -c ${CHROOT} -u root -- apt-cache search linux-header - - schroot -c ${CHROOT} -u root -- apt install -y linux-headers-`uname -r` - - wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_i386.deb - - schroot -c ${CHROOT} -u root -- apt install -y dpkg - - schroot -c ${CHROOT} -u root -- dpkg -i /tmp/downloads/nasm_2.13.02-0.1_i386.deb - - script: - - cd platforms/linux - - make -j$(nproc) - # Cross-compiling to 32-bit Linux - - schroot -c ${CHROOT} --directory ${CHROOT_DIR}/haxm/platforms/linux -- make -j$(nproc) - - - name: "haxm-windows" - os: windows - install: - - choco install -y nuget.commandline - - choco install -y windowsdriverkit10 - - choco install -y windows-sdk-10.1 - script: - - cd platforms/windows - - nuget restore - - export PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio/Installer/" - - export MSVC=$(vswhere -latest -products "*" -requires Microsoft.Component.MSBuild -property installationPath) - - export MSVC=$(echo /$MSVC | sed -e 's/\\/\//g' -e 's/://') - - export PATH="$PATH:$MSVC/MSBuild/15.0/Bin/" - # TODO: Remove the following hack when no longer needed. - # NOTE: Officially WDK does not support VS Build Tools, only regular VS/EWDK installations, - # but since those are not supported by TravisCI, we need to install targets manually. - - unzip "/c/Program Files (x86)/Windows Kits/10/Vsix/WDK.vsix" -d wdk - - cp -R wdk/\$VCTargets/* "$MSVC/Common7/IDE/VC/VCTargets" - - export PROPS="//p:SpectreMitigation=false" - - MSBuild.exe haxm.sln $PROPS //p:Configuration="Debug" //p:Platform="Win32" - - MSBuild.exe haxm.sln $PROPS //p:Configuration="Debug" //p:Platform="x64" - - build/tests/x64/Debug/haxm-tests.exe