Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Make existing build workflows reusable #499

Merged
merged 32 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
633329e
ci: refactor msbuild workflow to be reusable
traunts Jun 11, 2023
dd51792
ci: refactor meson build workflow to be reusable
traunts Jun 11, 2023
82e8087
ci: refactor to set meson version via an environment variable
traunts Jun 11, 2023
dd15a3c
ci: rename CI workflow
traunts Jun 11, 2023
1e337f9
ci: refactor CI workflow to use new reusable workflows
traunts Jun 11, 2023
d64a294
ci: disable CI triggers on push to `master`
traunts Jun 11, 2023
8d43292
ci: fix incorrect options for `if-no-files-found` Action input
traunts Jun 13, 2023
def43b5
ci: correct artefact upload path for msbuild
traunts Jun 13, 2023
d167ee9
Merge branch 'development' into 470-make-existing-build-workflows-reu…
traunts Jul 4, 2023
601fe2d
ci: update workflow_dispatch inputs so manual triggers are correctly …
traunts Jul 4, 2023
acd661e
ci: format and update workflow input descriptions
traunts Jul 4, 2023
23bc29c
test mapping build_config to executable name
traunts Jul 4, 2023
1496969
fix bad yaml syntax in exe name mapping and switch to conditional ste…
traunts Jul 4, 2023
57a6a64
temp reordering to fix bad format string
traunts Jul 4, 2023
7668113
Fix incorrect quotes in json strings
traunts Jul 4, 2023
d3b3a49
Reorder steps post-debug
traunts Jul 4, 2023
69a7dad
Further debugging changes to json mapping
traunts Jul 4, 2023
bcf5393
Testing quotes issues?
traunts Jul 4, 2023
bd828e8
Sanity checks
traunts Jul 4, 2023
50527fa
remove unsupported env name
traunts Jul 4, 2023
ca7e94b
force bash shells
traunts Jul 4, 2023
d693d1c
force bash shells
traunts Jul 4, 2023
90b05a7
Merge branch '470-make-existing-build-workflows-reusable' of https://…
traunts Jul 4, 2023
baa57a2
Remove sanity check and reorder steps, revert to using step outputs r…
traunts Jul 5, 2023
a2b1355
Input Mapping formatting
traunts Jul 5, 2023
e3a7c44
Create a new workflow to upload master build artefacts
traunts Jul 5, 2023
be1e4ed
Update workflow trigger comments to better document input schema
traunts Jul 7, 2023
6999a7f
Update workflow trigger comment descriptions, and standardise between…
traunts Jul 7, 2023
1db7721
Merge branch 'development' into 470-make-existing-build-workflows-reu…
traunts Jul 7, 2023
bce1776
Fix macOS workflow runs not finding the debug version of the executab…
traunts Jul 7, 2023
c4e9059
extglob is not available on the GitHub Actions runners, reverted to m…
traunts Jul 7, 2023
476294b
ci: remove unneeded clang installation step
traunts Jul 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 0 additions & 92 deletions .github/workflows/build-check.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Continuous Integration

on:
# Triggers the workflow for pushes to development, for pull request events, and for the merge queue
push:
branches: [development]
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
merge_group:
types: [checks_requested]

workflow_dispatch:

# Cancel in-progress runs if newer changes to the same branch/PR are pushed.
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
meson:
uses: ./.github/workflows/meson.yml

msbuild:
uses: ./.github/workflows/msbuild.yml

27 changes: 27 additions & 0 deletions .github/workflows/master_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

name: Master Build

on:
# Triggers the workflow for pushes to master
push:
branches: [master]

workflow_dispatch:

# Cancel in-progress runs if newer changes to the same branch/PR are pushed.
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

# Build the game on all platforms and store build artefacts of both jobs
jobs:
meson:
uses: ./.github/workflows/meson.yml
with:
upload_artefacts: true

msbuild:
uses: ./.github/workflows/msbuild.yml
with:
upload_artefacts: true

104 changes: 77 additions & 27 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,57 @@
name: Meson Build (Linux, macOS)
# Controls when the action will run.

on:
# Triggers the workflow on push or pull request events but only for the development branch
push:
branches: [ master, development ]
release:
# Triggers the workflow when manually dispatched
workflow_dispatch:
inputs:
upload_artefacts:
description: "Upload build artefacts"
type: boolean
required: false
default: false
build_type:
description: "Build Configuration"
type: choice
required: false
default: "release"
options:
- "release"
- "debug"
debug_level:
description: "Debug Level"
type: choice
required: false
default: "release"
options:
- "release"
- "minimal"
- "full"

# Triggers the workflow when called by a top-level workflow
workflow_call:
inputs:
upload_artefacts:
type: boolean
required: false
default: false
build_type: # "release" | "debug"
type: string
required: false
default: "release"
debug_level: # "full" | "minimal" | "release"
type: string
required: false
default: "release"

env:
MESON_VERSION: "0.60.3"


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-release-linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
build-linux:

runs-on: ubuntu-latest
name: Linux Build

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
Expand All @@ -26,36 +61,44 @@ jobs:
run: |
sudo apt-get update -yq
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev libtbb-dev libsdl2-dev libopengl-dev libfuse2 ninja-build
sudo pip install meson==0.60.0
sudo pip install meson==${{env.MESON_VERSION}}

- name: Install Clang
# You may pin to the exact commit or the version.
# uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d
uses: egor-tensin/setup-clang@v1
with:
# Set up cc/c++ executables
cc: 1 # optional, default is 1
- name: Setup Meson
env:
CC: "gcc"
CXX: "g++"
run: |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} build

- name: Configure for AppImage
if: ${{inputs.upload_artefacts}}
env:
CC: "gcc"
CXX: "g++"
run: meson configure -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build

- name: Build
env:
CC: "gcc"
CXX: "g++"
run: |
meson setup --buildtype=release -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build
meson compile -C build

- name: Create AppDir
if: ${{inputs.upload_artefacts}}
run: |
echo "Setting output prefix"
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build"

- name: Download linuxdeploy
if: ${{inputs.upload_artefacts}}
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy
chmod +x lindeploy

- name: Create AppImage
if: ${{inputs.upload_artefacts}}
working-directory: ${{env.GITHUB_WORKSPACE}}
env:
LD_LIBRARY_PATH: ./external/lib/linux/x86_64/
Expand All @@ -65,33 +108,40 @@ jobs:
./lindeploy --appdir=build/AppDir --output appimage

- name: Upload Appimage
if: ${{inputs.upload_artefacts}}
uses: actions/upload-artifact@v3
with:
name: CortexCommand (Linux)
path: CortexCommand.AppImage
if-no-files-found: error

build-release-macos:
build-macos:
runs-on: macos-latest
name: MacOS Build

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install Dependencies
run: |
brew install pkg-config tbb sdl2 minizip lz4 flac luajit lua@5.1 libpng gcc ninja meson

brew install pkg-config tbb sdl2 minizip lz4 flac luajit lua@5.1 libpng gcc@12 ninja meson
- name: Build
env:
CC: "gcc-12"
CXX: "g++-12"
LDFLAGS: "-static-libgcc -static-libstdc++"
run: |
meson setup --buildtype=release -Ddebug_type=release build
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} build
meson compile -C build

- name: Artifact Deploy
if: ${{inputs.upload_artefacts}}
uses: actions/upload-artifact@v3
with:
name: CortexCommand (macOS)
path: build/CortexCommand
path: |
build/CortexCommand
build/CortexCommand_debug
if-no-files-found: error
Loading