Skip to content

Commit

Permalink
Use dependent jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Jul 9, 2023
1 parent 1a27e60 commit acebc76
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 178 deletions.
92 changes: 0 additions & 92 deletions .github/actions/build/action.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/actions/deps-windows/deps-windows.yaml

This file was deleted.

11 changes: 1 addition & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
description: The script that installs dependencies.
type: string
required: false
default: echo No deps
runs-on:
description: The platform on which the workflow will be run. Passed directly to jobs.<job_id>.runs-on.
type: string
Expand Down Expand Up @@ -74,16 +75,6 @@ jobs:
- name: Check Out Source
uses: actions/checkout@v3

- name: Install MSYS2
uses: msys2/setup-msys2@v2
if: contains(inputs.shell, 'msys2')
with:
msystem: MINGW64
update: true

- name: Install Dependencies
run: ${{ inputs.deps }}

- name: Set Up CCache
uses: hendrikmuhs/[email protected]
with:
Expand Down
76 changes: 50 additions & 26 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,82 +8,106 @@ on:
branches:
- main
jobs:
deps-windows:
name: Install Dependencies (Windows)
runs-on: windows-latest
steps:
- name: Install Dependencies
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git pkgconf mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-ninja mingw-w64-x86_64-toolchain

deps-macos:
name: Install Dependencies (macOS)
runs-on: macos-latest
steps:
- name: Install Dependencies
run: brew install pkg-config cmake ninja ccache

deps-linux-x86_64:
name: Install Dependencies (Linux x86_64)
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/kubernetes.list
# Don't check for dependencies that we won't use
sudo apt-get update
sudo apt-get install -y cmake ninja-build libepoxy-dev ccache
deps-linux-aaarch64:
name: Install Dependencies (Linux aarch64)
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo dpkg --add-architecture arm64
sudo sh -c "sed \"s|^deb \([a-z\.:/]*\) \([a-z\-]*\) \(.*\)$|deb [arch=amd64] \1 \2 \3\ndeb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports \2 \3|\" /etc/apt/sources.list > /etc/apt/sources.list.new"
sudo rm -f /etc/apt/sources.list
sudo mv /etc/apt/sources.list{.new,}
sudo apt-get update
sudo apt-get install -y {gcc-10,g++-10}-aarch64-linux-gnu {pkg-config,libepoxy-dev}:arm64 cmake ninja-build extra-cmake-modules dpkg-dev ccache
windows:
name: Windows (x86_64)
needs: [deps-windows]
uses: ./.github/workflows/build.yaml
with:
archive-name: melondsds_libretro-win32-x86_64
runs-on: windows-latest
info-dir: info
lib-ext: dll
shell: msys2 {0}
deps: |
pacman -Sq --noconfirm git pkgconf mingw-w64-x86_64-{cmake,ccache,ninja,toolchain}

macos:
name: macOS (Universal)
needs: [deps-macos]
uses: ./.github/workflows/build.yaml
with:
archive-name: melondsds_libretro-macos-universal
runs-on: macos-latest
lib-ext: dylib
deps: |
brew install pkg-config cmake ninja ccache

linux-x86_64:
name: Linux (x86_64)
needs: [deps-linux-x86_64]
uses: ./.github/workflows/build.yaml
with:
archive-name: melondsds_libretro-linux-x86_64
runs-on: ubuntu-latest
lib-ext: so
deps: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/kubernetes.list
# Don't check for dependencies that we won't use
sudo apt-get update
sudo apt-get install -y cmake ninja-build libepoxy-dev ccache

linux-aarch64:
name: Linux (aarch64)
needs: [deps-linux-aaarch64]
uses: ./.github/workflows/build.yaml
with:
archive-name: melondsds_libretro-linux-aarch64
runs-on: ubuntu-latest
lib-ext: so
deps: |
sudo apt-get update
sudo dpkg --add-architecture arm64
sudo sh -c "sed \"s|^deb \([a-z\.:/]*\) \([a-z\-]*\) \(.*\)$|deb [arch=amd64] \1 \2 \3\ndeb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports \2 \3|\" /etc/apt/sources.list > /etc/apt/sources.list.new"
sudo rm -f /etc/apt/sources.list
sudo mv /etc/apt/sources.list{.new,}
sudo apt-get update
sudo apt-get install -y {gcc-10,g++-10}-aarch64-linux-gnu {pkg-config,libepoxy-dev}:arm64 cmake ninja-build extra-cmake-modules dpkg-dev ccache

android:
name: Android
needs: [deps-linux-x86_64]
uses: ./.github/workflows/build.yaml
with:
lib-ext: so
archive-name: melondsds_libretro-android
lib-name: melondsds_libretro_android
cmake-args: -DENABLE_OGLRENDERER=OFF -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=22 -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK/build/cmake/android.toolchain.cmake"
runs-on: ubuntu-latest
deps: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/kubernetes.list
# Don't check for dependencies that we won't use
sudo apt-get update
sudo apt-get install -y cmake ninja-build ccache

ios:
name: iOS
needs: [deps-macos]
uses: ./.github/workflows/build.yaml
with:
runs-on: macos-latest
archive-name: melondsds_libretro-ios
lib-ext: dylib
lib-name: melondsds_libretro_ios
cmake-args: -DENABLE_OGLRENDERER=OFF -DENABLE_JIT=OFF --toolchain ./cmake/toolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=13.0 -DDEPLOYMENT_TARGET=13 -DENABLE_STRICT_TRY_COMPILE_INT:BOOL=ON
deps: |
brew install pkg-config cmake ninja ccache
34 changes: 0 additions & 34 deletions .github/workflows/main2.yaml

This file was deleted.

0 comments on commit acebc76

Please sign in to comment.