From 5c500bee589da4fc575d2f86a8b8cb7a8bc7bcc8 Mon Sep 17 00:00:00 2001 From: Yongwei Ma Date: Wed, 24 Mar 2021 18:26:48 +0800 Subject: [PATCH 1/4] Remove the TravisCI yaml file Signed-off-by: Yongwei Ma --- .travis.yml | 77 ----------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 .travis.yml 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 From 6c2da12b82ba9f8537efd32fadccc70671fccbe6 Mon Sep 17 00:00:00 2001 From: Yongwei Ma Date: Wed, 24 Mar 2021 22:05:27 +0800 Subject: [PATCH 2/4] Add Action build yml file for Windows OS Signed-off-by: Yongwei Ma --- .github/workflows/HaxmBuild.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/HaxmBuild.yml diff --git a/.github/workflows/HaxmBuild.yml b/.github/workflows/HaxmBuild.yml new file mode 100644 index 00000000..f10d4d01 --- /dev/null +++ b/.github/workflows/HaxmBuild.yml @@ -0,0 +1,29 @@ +name: HAXM build on Windows + +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 From 4b6a6ac8027e5280a34ba7cec23e73a4a236e634 Mon Sep 17 00:00:00 2001 From: Yongwei Ma Date: Wed, 24 Mar 2021 22:17:29 +0800 Subject: [PATCH 3/4] Add Action build yml file for macOS Signed-off-by: Yongwei Ma --- .github/workflows/HaxmBuild.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/HaxmBuild.yml b/.github/workflows/HaxmBuild.yml index f10d4d01..dad431dd 100644 --- a/.github/workflows/HaxmBuild.yml +++ b/.github/workflows/HaxmBuild.yml @@ -1,4 +1,4 @@ -name: HAXM build on Windows +name: HAXM build on Windows, macOS on: [push, pull_request] @@ -27,3 +27,13 @@ jobs: 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 From f432ef3e5a5368031df5b5742b16183c9b0151ab Mon Sep 17 00:00:00 2001 From: Yongwei Ma Date: Thu, 25 Mar 2021 10:57:19 +0800 Subject: [PATCH 4/4] Add Action build yml file for Linux Signed-off-by: Yongwei Ma --- .github/workflows/HaxmBuild.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/HaxmBuild.yml b/.github/workflows/HaxmBuild.yml index dad431dd..01b0247e 100644 --- a/.github/workflows/HaxmBuild.yml +++ b/.github/workflows/HaxmBuild.yml @@ -1,4 +1,4 @@ -name: HAXM build on Windows, macOS +name: HAXM build on Windows, macOS and Linux on: [push, pull_request] @@ -37,3 +37,16 @@ jobs: 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