gbe_fork/.github/workflows/emu-build-all-linux.yml

114 lines
3.7 KiB
YAML
Raw Normal View History

name: Build emu (Linux)
2024-05-11 18:13:59 +08:00
on:
workflow_call:
# needed since it allows this to become a reusable workflow
workflow_dispatch:
# allows manual trigger
permissions:
contents: write
2024-05-20 08:12:20 +08:00
env:
DEPS_CACHE_KEY: emu-deps-linux
DEPS_CACHE_DIR: build/deps/linux
PACKAGE_BASE_DIR: "build/package/linux"
THIRD_PARTY_BASE_DIR: 'third-party'
2024-05-11 18:13:59 +08:00
jobs:
deps:
name: Restore or build deps
if: ${{ !cancelled() }}
uses: ./.github/workflows/emu-deps-linux.yml
2024-05-11 18:13:59 +08:00
2024-05-20 08:12:20 +08:00
builds-matrix-linux:
2024-05-20 09:18:53 +08:00
name: build
2024-05-11 18:13:59 +08:00
needs: [ deps ]
2024-05-20 08:12:20 +08:00
runs-on: ubuntu-22.04
2024-05-11 18:13:59 +08:00
if: ${{ !cancelled() }}
continue-on-error: true
2024-05-20 08:12:20 +08:00
strategy:
fail-fast: false
2024-05-20 08:12:20 +08:00
matrix:
2024-05-20 09:16:43 +08:00
## notice how on linux everything is lowercase, `cd GBE_Build`, then: `make help`
2024-05-20 08:12:20 +08:00
prj: [ 'GenerateInterfaces', 'SteamClient', 'SteamEmu', ]
2024-05-20 09:16:43 +08:00
arch: [ 'x64', 'x32', ]
cfg: [ 'debug', 'release', 'experimentaldebug', 'experimentalrelease', ]
exclude:
- prj: 'GenerateInterfaces'
cfg: 'experimentaldebug'
- prj: 'GenerateInterfaces'
cfg: 'experimentalrelease'
2024-05-20 08:12:20 +08:00
steps:
2024-05-20 08:15:21 +08:00
### clone branch
- name: Checkout branch
uses: actions/checkout@v4
2024-05-20 08:12:20 +08:00
### deps
- name: Restore deps
id: emu-deps-cache-step
uses: actions/cache@v4
with:
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
## mandatory Linux packages, installed via sudo apt install ...
- name: Install required packages
shell: bash
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh -verbose -packages_only
## extra helpers/tools, these are not built inside the deps build dir
- name: Clone third-party build helpers (common/linux)
uses: actions/checkout@v4
with:
ref: 'third-party/common/linux'
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/linux"
- name: Clone third-party build helpers (build/linux)
uses: actions/checkout@v4
with:
ref: 'third-party/build/linux'
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux"
### fix folder permissions! not sure why this fails
# nested subdirs "build/linux/release" cause permission problems
- name: Give all permissions to repo folder
shell: bash
working-directory: ${{ github.workspace }}
run: sudo chmod -R 777 "${{ github.workspace }}"
### generate project files
## TODO gen proto action is broken, always returns error = 1
- name: Generate project files
shell: bash
working-directory: ${{ github.workspace }}
run: |
sudo chmod 777 ./third-party/common/linux/premake/premake5
./third-party/common/linux/premake/premake5 --file=premake5.lua --os=linux generateproto || echo ;
2024-05-20 08:12:20 +08:00
./third-party/common/linux/premake/premake5 --file=premake5.lua --emubuild=${{ github.sha }} --os=linux gmake2
exit 0
### build target(s)
- name: Build target(s)
shell: bash
working-directory: ${{ github.workspace }}/GBE_Build
run: |
echo "dry run..."
CC=clang CXX=clang++ make -n -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
echo "actual run..."
CC=clang CXX=clang++ make -j 2 config=${{ matrix.cfg }}_${{ matrix.arch }} ${{ matrix.prj }}
2024-05-20 08:12:20 +08:00
### upload artifact/package to github Actions (for targets)
- name: Upload build package (for targets)
uses: actions/upload-artifact@v4
with:
name: "emu-linux-${{ matrix.prj }}-${{ matrix.cfg }}-${{ matrix.arch }}-${{ github.sha }}"
path: "bin/"
if-no-files-found: 'error'
compression-level: 9
retention-days: 1