From e10b5cfc4e78524bbd1c03afb8cdbeec03828bff Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 16:21:48 -0700 Subject: [PATCH 1/8] Add GitHub Actions CI --- .github/workflows/ci.yml | 157 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..a2405ebbf36 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,157 @@ +name: CI + +on: + push: + paths-ignore: + - 'CHANGES' + - '.github/*' + - '.gitignore' + - '*.yml' + - 'docs/**' +# pull_request: + +jobs: + build-windows-docker: + runs-on: ubuntu-latest + #container: mgba/windows:w64 + steps: + - uses: actions/checkout@v3 + #- run: mkdir -p build-win64 + - name: Docker + run: docker run --rm -v ${PWD}:/home/mgba/src mgba/windows:w64 + - run: ls + + build-windows-msys2: + runs-on: windows-latest + env: + POWERSHELL_TELEMETRY_OPTOUT: 1 + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + - uses: msys2/setup-msys2@v2 + - name: Setup + env: + MINGW_PACKAGE_PREFIX: mingw64 + run: | + pacman -Sy --noconfirm --needed base-devel git ${MINGW_PACKAGE_PREFIX}-{cmake,ffmpeg,gcc,gdb,libelf,libepoxy,libzip,lua,pkgconf,qt5,SDL2,ntldd-git,7zip} + mkdir -p build + - name: CMake + working-directory: build + run: cmake .. -G"MSYS Makefiles" + - name: Build + working-directory: build + run: cmake --build . -j$NUMBER_OF_PROCESSORS + - name: Create artifact + id: artifact + working-directory: build + run: | + cpack -G ZIP + zip=$(ls *.zip) + 7z x "$zip" + echo "name=${zip//.zip}" >> "$GITHUB_OUTPUT" + - uses: actions/upload-artifact@v3 + with: + name: ${{ steps.artifact.outputs.name }} + path: build\${{ steps.artifact.outputs.name }} + if-no-files-found: error + + build-windows-vcpkg: + runs-on: windows-2019 #latest + strategy: + #fail-fast: false + matrix: + configuration: [Release] #, Debug + env: + POWERSHELL_TELEMETRY_OPTOUT: 1 + VCPKG_BUILD_TYPE: ${{ matrix.configuration }} + VCPKG_DEFAULT_TRIPLET: x64-windows-release + VCPKG_DISABLE_METRICS: 1 + #VCPKG_TARGET_ARCHITECTURE: x64 + steps: + - uses: actions/checkout@v3 + - name: Setup + run: | + C:\vcpkg\bootstrap-vcpkg.bat + vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip lua sdl2 sqlite3 + vcpkg --no-dry-run upgrade + - uses: jurplel/install-qt-action@v3.2.1 + with: + cache: true + #setup-python: false + - name: CMake + working-directory: build + run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DZLIB_LIBRARY=zlib + - name: Build + working-directory: build + run: cmake --build . -j$env:NUMBER_OF_PROCESSORS + + build-windows-cross: + runs-on: ubuntu-latest + #env: + # CC: x86_64-w64-mingw32-gcc + # CXX: x86_64-w64-mingw32-g++ + steps: + - uses: actions/checkout@v3 + - name: Setup + run: | + sudo apt-get -y update + sudo apt-get -y install libepoxy-dev libsdl2-dev libglu1-mesa-dev mesa-common-dev mingw-w64 + mkdir -p build + - uses: jurplel/install-qt-action@v3.2.1 + with: + cache: true + setup-python: false + - name: CMake + working-directory: build + run: cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ + - name: Build + working-directory: build + #env: + # CC: x86_64-w64-mingw32-gcc + # CXX: x86_64-w64-mingw32-g++ + #run: make -j$(nproc) + run: cmake --build . -j$(nproc) + - name: Create artifacts + working-directory: build + run: cpack -G ZIP + - uses: actions/upload-artifact@v3 + with: + name: mgba-windows-cross + path: build/*.zip + if-no-files-found: error + + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup + run: | + sudo apt-get -y update + sudo apt-get -y install libsdl2-dev + - uses: jurplel/install-qt-action@v3.2.1 + with: + cache: true + setup-python: false + - name: CMake + run: cmake -Bbuild + - name: Build + run: cmake --build build -j$(nproc) + + build-macos: + runs-on: macos-latest + env: + HOMEBREW_NO_ANALYTICS: 1 + steps: + - uses: actions/checkout@v3 + - name: Setup + run: brew install cmake ffmpeg libzip qt5 sdl2 libedit lua pkg-config + #- uses: jurplel/install-qt-action@v3.2.1 + # with: + # cache: true + # #setup-python: false + - name: CMake + run: cmake -Bbuild #-DCMAKE_PREFIX_PATH=$(brew --prefix qt5) # prefix might not be needed + - name: Build + run: cmake --build build -j$(getconf _NPROCESSORS_ONLN) From b3a7efeaad77dad531acdc54d6b951303396288e Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 16:57:36 -0700 Subject: [PATCH 2/8] Update ci.yml --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2405ebbf36..a01a9b4b6e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,12 +34,12 @@ jobs: - name: Setup env: MINGW_PACKAGE_PREFIX: mingw64 - run: | - pacman -Sy --noconfirm --needed base-devel git ${MINGW_PACKAGE_PREFIX}-{cmake,ffmpeg,gcc,gdb,libelf,libepoxy,libzip,lua,pkgconf,qt5,SDL2,ntldd-git,7zip} - mkdir -p build + run: pacman -Sy --noconfirm --needed base-devel git ${MINGW_PACKAGE_PREFIX}-{cmake,ffmpeg,gcc,gdb,libelf,libepoxy,libzip,lua,pkgconf,qt5,SDL2,ntldd-git,7zip} - name: CMake - working-directory: build - run: cmake .. -G"MSYS Makefiles" + run: | + mkdir build + cd build + cmake .. -G"MSYS Makefiles" - name: Build working-directory: build run: cmake --build . -j$NUMBER_OF_PROCESSORS From 290c8ee831732c2a487787761d22337efb960624 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 17:05:12 -0700 Subject: [PATCH 3/8] Update ci.yml --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a01a9b4b6e0..56c4b9f4954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,12 +34,12 @@ jobs: - name: Setup env: MINGW_PACKAGE_PREFIX: mingw64 - run: pacman -Sy --noconfirm --needed base-devel git ${MINGW_PACKAGE_PREFIX}-{cmake,ffmpeg,gcc,gdb,libelf,libepoxy,libzip,lua,pkgconf,qt5,SDL2,ntldd-git,7zip} - - name: CMake run: | + pacman -Sy --noconfirm --needed base-devel git ${MINGW_PACKAGE_PREFIX}-{cmake,ffmpeg,gcc,gdb,libelf,libepoxy,libzip,lua,pkgconf,qt5,SDL2,ntldd-git,7zip} mkdir build - cd build - cmake .. -G"MSYS Makefiles" + - name: CMake + working-directory: build + run: cmake .. -G"MSYS Makefiles" - name: Build working-directory: build run: cmake --build . -j$NUMBER_OF_PROCESSORS @@ -76,6 +76,7 @@ jobs: C:\vcpkg\bootstrap-vcpkg.bat vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip lua sdl2 sqlite3 vcpkg --no-dry-run upgrade + mkdir build - uses: jurplel/install-qt-action@v3.2.1 with: cache: true From 42a8475869405de8ff73a3f5edbde825eda8a127 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 18:01:36 -0700 Subject: [PATCH 4/8] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56c4b9f4954..18135a0c997 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup run: | - C:\vcpkg\bootstrap-vcpkg.bat + #C:\vcpkg\bootstrap-vcpkg.bat vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip lua sdl2 sqlite3 vcpkg --no-dry-run upgrade mkdir build @@ -83,7 +83,7 @@ jobs: #setup-python: false - name: CMake working-directory: build - run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DZLIB_LIBRARY=zlib + run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake #-DZLIB_LIBRARY=zlib - name: Build working-directory: build run: cmake --build . -j$env:NUMBER_OF_PROCESSORS From f0be2338b01df4636918c464fc434c872fcf3dc6 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 18:08:42 -0700 Subject: [PATCH 5/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18135a0c997..15c043349e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: #setup-python: false - name: CMake working-directory: build - run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake #-DZLIB_LIBRARY=zlib + run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" - name: Build working-directory: build run: cmake --build . -j$env:NUMBER_OF_PROCESSORS From b8645fc996020fc14399aecf15919a3ae79ce64e Mon Sep 17 00:00:00 2001 From: Margen67 Date: Fri, 2 Jun 2023 18:17:44 -0700 Subject: [PATCH 6/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15c043349e0..58121b91b0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: #setup-python: false - name: CMake working-directory: build - run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + run: cmake .. -DCMAKE_CONFIGURATION_TYPES=$env:VCPKG_BUILD_TYPE -DZLIB_LIBRARY=zlib -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" - name: Build working-directory: build run: cmake --build . -j$env:NUMBER_OF_PROCESSORS From e8bd52df77a81597572f24f5788acd1f23eda374 Mon Sep 17 00:00:00 2001 From: Margen67 Date: Sat, 3 Jun 2023 07:21:31 -0700 Subject: [PATCH 7/8] Update ci.yml --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58121b91b0c..4d7a64214cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,9 +73,13 @@ jobs: - uses: actions/checkout@v3 - name: Setup run: | - #C:\vcpkg\bootstrap-vcpkg.bat + cd $env:VCPKG_INSTALLATION_ROOT + .\bootstrap-vcpkg + vcpkg integrate install vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip lua sdl2 sqlite3 vcpkg --no-dry-run upgrade + vcpkg integrate install + cd - mkdir build - uses: jurplel/install-qt-action@v3.2.1 with: From c87358a0b975f9e4ef89ccd7e4b9270e0d94535f Mon Sep 17 00:00:00 2001 From: Margen67 Date: Sat, 3 Jun 2023 07:37:19 -0700 Subject: [PATCH 8/8] Update ci.yml --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d7a64214cb..916ef761f36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,7 @@ jobs: vcpkg install ffmpeg[vpx,x264] libepoxy libpng libzip lua sdl2 sqlite3 vcpkg --no-dry-run upgrade vcpkg integrate install + echo "${env:VCPKG_INSTALLATION_ROOT}\installed\x64-windows-release\bin" >> "$GITHUB_PATH" cd - mkdir build - uses: jurplel/install-qt-action@v3.2.1