From 7a681e24919b439ad7133b3f44333a34634098f3 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 15 Nov 2019 17:23:49 -0700 Subject: [PATCH] ci: Add GitHub Actions build workflows --- .github/workflows/build_macos.yml | 38 +++++++++++++++++++ .github/workflows/build_ubuntu.yml | 38 +++++++++++++++++++ .github/workflows/build_windows.yml | 57 +++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 .github/workflows/build_macos.yml create mode 100644 .github/workflows/build_ubuntu.yml create mode 100644 .github/workflows/build_windows.yml diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml new file mode 100644 index 0000000000..9feebcaabe --- /dev/null +++ b/.github/workflows/build_macos.yml @@ -0,0 +1,38 @@ +name: Build (macOS) + +on: [push, pull_request] + +jobs: + macOS: + runs-on: macOS-latest + strategy: + matrix: + configuration: ["Debug", "Release"] + steps: + - name: Define Build Options + shell: python + run: | + if "${{ matrix.configuration }}" == "Debug": + print('Configuring for Debug') + print('::set-env name=BUILD_PARAM::') + print('::set-env name=ARTIFACT_NAME::xqemu-debug') + else: + print('Configuring for Release') + print('::set-env name=BUILD_PARAM::--release') + print('::set-env name=ARTIFACT_NAME::xqemu-release') + - name: Clone Tree + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install Dependencies + run: | + brew update + brew install \ + glib \ + pixman \ + sdl2 \ + libepoxy \ + coreutils \ + pkg-config + - name: Compile + run: ./build.sh ${{ env.BUILD_PARAM }} diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml new file mode 100644 index 0000000000..9c7f9c13b6 --- /dev/null +++ b/.github/workflows/build_ubuntu.yml @@ -0,0 +1,38 @@ +name: Build (Ubuntu) + +on: [push, pull_request] + +jobs: + Ubuntu: + runs-on: ubuntu-latest + strategy: + matrix: + configuration: ["Debug", "Release"] + steps: + - name: Define Build Options + shell: python + run: | + if "${{ matrix.configuration }}" == "Debug": + print('Configuring for Debug') + print('::set-env name=BUILD_PARAM::') + print('::set-env name=ARTIFACT_NAME::xqemu-debug') + else: + print('Configuring for Release') + print('::set-env name=BUILD_PARAM::--release') + print('::set-env name=ARTIFACT_NAME::xqemu-release') + - name: Clone Tree + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + pkg-config \ + libsdl2-dev \ + libepoxy-dev \ + zlib1g-dev \ + libpixman-1-dev + - name: Compile + run: ./build.sh ${{ env.BUILD_PARAM }} diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 0000000000..6d735abbf1 --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,57 @@ +name: Build (Windows) + +on: [push, pull_request] + +jobs: + Windows: + runs-on: windows-latest + strategy: + matrix: + configuration: ["Debug", "Release"] + steps: + - name: Define Build Options + shell: python + run: | + if "${{ matrix.configuration }}" == "Debug": + print('Configuring for Debug') + print('::set-env name=BUILD_PARAM::') + print('::set-env name=ARTIFACT_NAME::xqemu-debug') + else: + print('Configuring for Release') + print('::set-env name=BUILD_PARAM::--release') + print('::set-env name=ARTIFACT_NAME::xqemu-release') + - name: Clone Tree + uses: actions/checkout@v1 + with: + fetch-depth: 1 + # + # An environment could be created as follows. Instead, use a pre-built + # toolchain to accelerate build times. + # + # - name: Install Dependencies + # run: | + # choco install msys2 + # C:\tools\msys64\usr\bin\bash -xlc "pacman --noconfirm -S --needed base-devel git make autoconf automake-wrapper mingw-w64-x86_64-libtool mingw-w64-x86_64-pkg-config mingw-w64-x86_64-glib2 mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pixman mingw-w64-x86_64-libepoxy" + # - name: Compile + # shell: cmd + # run: | + # C:\tools\msys64\usr\bin\bash -xlc "cd $GITHUB_WORKSPACE; export PATH="/mingw64/bin:$PATH"; ./build.sh" + # + - name: Install Dependencies + run: | + echo "Downloading MSYS2 environment..." + Invoke-WebRequest -Uri "https://dl.dropboxusercontent.com/s/8lt6464xtk00t59/msys64.7z" -OutFile "msys64.7z" + echo "Extracting MSYS2 environment..." + 7z x -y msys64.7z "-oC:\" + echo "Updating MSYS2 environment..." + C:\msys64\usr\bin\bash.exe -lc "pacman -Syu" + - name: Compile + shell: cmd + run: | + echo $GITHUB_WORKSPACE + C:\msys64\usr\bin\bash.exe -lc "cd $GITHUB_WORKSPACE; export PATH="/mingw64/bin:$PATH"; ./build.sh ${{ env.BUILD_PARAM }}" + - name: Upload Build Artifact + uses: actions/upload-artifact@master + with: + name: ${{env.ARTIFACT_NAME}} + path: dist