diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..f67fdc425e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,153 @@ +name: Build + +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 + - name: Install Dependencies + run: | + echo "Downloading MSYS2 environment..." + Invoke-WebRequest -Uri "https://github.com/xqemu/ci-environment-msys2/releases/latest/download/msys64.7z" -OutFile "msys64.7z" + echo "Extracting MSYS2 environment..." + 7z x -y msys64.7z "-oC:\tools\" + echo "Updating MSYS2 environment..." + C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm" + - name: Initialize Compiler Cache + id: cache + uses: actions/cache@v1 + with: + path: C:\tools\msys64\tmp\xqemu-ccache + key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} + restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- + - name: Compile + run: | + C:\tools\msys64\usr\bin\bash.exe -lc @" + set -e + cd `$GITHUB_WORKSPACE + export CCACHE_DIR=/tmp/xqemu-ccache + export CCACHE_MAXSIZE=250M + export PATH="/usr/lib/ccache/bin:/mingw64/bin:`$PATH" + ./build.sh ${{ env.BUILD_PARAM }} + echo -e '\nCompiler Cache Stats:' + ccache -s -c + "@ + - name: Upload Build Artifact + uses: actions/upload-artifact@master + with: + name: ${{env.ARTIFACT_NAME}} + path: dist + + 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 \ + libsdl2-dev \ + libepoxy-dev \ + libpixman-1-dev \ + ccache + - name: Initialize Compiler Cache + id: cache + uses: actions/cache@v1 + with: + path: /tmp/xqemu-ccache + key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} + restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- + - name: Compile + run: | + export CCACHE_DIR=/tmp/xqemu-ccache + export CCACHE_MAXSIZE=250M + export PATH="/usr/lib/ccache:$PATH" + ./build.sh ${{ env.BUILD_PARAM }} + echo -e "\nCompiler Cache Stats:" + ccache -s -c + + 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 unlink python@2 + brew install \ + glib \ + pixman \ + sdl2 \ + libepoxy \ + coreutils \ + pkg-config \ + ccache + - name: Initialize Compiler Cache + id: cache + uses: actions/cache@v1 + with: + path: /tmp/xqemu-ccache + key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} + restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- + - name: Compile + run: | + export CCACHE_DIR=/tmp/xqemu-ccache + export CCACHE_MAXSIZE=250M + export PATH="/usr/local/opt/ccache/libexec:$PATH" + ./build.sh ${{ env.BUILD_PARAM }} + echo -e "\nCompiler Cache Stats:" + ccache -s -c + diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml deleted file mode 100644 index caf9d83898..0000000000 --- a/.github/workflows/build_macos.yml +++ /dev/null @@ -1,53 +0,0 @@ -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 unlink python@2 - brew install \ - glib \ - pixman \ - sdl2 \ - libepoxy \ - coreutils \ - pkg-config \ - ccache - - name: Initialize Compiler Cache - id: cache - uses: actions/cache@v1 - with: - path: /tmp/xqemu-ccache - key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} - restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- - - name: Compile - run: | - export CCACHE_DIR=/tmp/xqemu-ccache - export CCACHE_MAXSIZE=250M - export PATH="/usr/local/opt/ccache/libexec:$PATH" - ./build.sh ${{ env.BUILD_PARAM }} - echo -e "\nCompiler Cache Stats:" - ccache -s -c diff --git a/.github/workflows/build_ubuntu.yml b/.github/workflows/build_ubuntu.yml deleted file mode 100644 index 07256c2715..0000000000 --- a/.github/workflows/build_ubuntu.yml +++ /dev/null @@ -1,49 +0,0 @@ -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 \ - libsdl2-dev \ - libepoxy-dev \ - libpixman-1-dev \ - ccache - - name: Initialize Compiler Cache - id: cache - uses: actions/cache@v1 - with: - path: /tmp/xqemu-ccache - key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} - restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- - - name: Compile - run: | - export CCACHE_DIR=/tmp/xqemu-ccache - export CCACHE_MAXSIZE=250M - export PATH="/usr/lib/ccache:$PATH" - ./build.sh ${{ env.BUILD_PARAM }} - echo -e "\nCompiler Cache Stats:" - ccache -s -c diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml deleted file mode 100644 index 716757c51e..0000000000 --- a/.github/workflows/build_windows.yml +++ /dev/null @@ -1,58 +0,0 @@ -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 - - name: Install Dependencies - run: | - echo "Downloading MSYS2 environment..." - Invoke-WebRequest -Uri "https://github.com/xqemu/ci-environment-msys2/releases/latest/download/msys64.7z" -OutFile "msys64.7z" - echo "Extracting MSYS2 environment..." - 7z x -y msys64.7z "-oC:\tools\" - echo "Updating MSYS2 environment..." - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Syu --noconfirm" - - name: Initialize Compiler Cache - id: cache - uses: actions/cache@v1 - with: - path: C:\tools\msys64\tmp\xqemu-ccache - key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }} - restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}- - - name: Compile - run: | - C:\tools\msys64\usr\bin\bash.exe -lc @" - set -e - cd `$GITHUB_WORKSPACE - export CCACHE_DIR=/tmp/xqemu-ccache - export CCACHE_MAXSIZE=250M - export PATH="/usr/lib/ccache/bin:/mingw64/bin:`$PATH" - ./build.sh ${{ env.BUILD_PARAM }} - echo -e '\nCompiler Cache Stats:' - ccache -s -c - "@ - - name: Upload Build Artifact - uses: actions/upload-artifact@master - with: - name: ${{env.ARTIFACT_NAME}} - path: dist