Skip to content

Commit

Permalink
feat(build): allow running build job on separate OS
Browse files Browse the repository at this point in the history
This should help reduce costs for Apple Silicon builds, as they are not
available on any form of free tier of GitHub Actions at the moment.

The build step that actually runs Emacs' configure script, and compiles
Emacs, is the only step that actually needs to run on the target
hardware architecture. The rest should be architecture agnostic.
  • Loading branch information
jimeh committed Nov 19, 2023
1 parent f1bd559 commit 40c7b2b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ on:
os:
description: GitHub Actions runner OS
type: string
required: true
required: false
default: "macos-11"
build_os:
description: Target OS to build for
type: string
required: false
default: "macos-11"
git_ref:
description: Git ref to build
type: string
Expand Down Expand Up @@ -127,7 +133,7 @@ jobs:
if: ${{ steps.check.outputs.result == 'fail' }}

build:
runs-on: ${{ inputs.os }}
runs-on: ${{ inputs.build_os }}
needs: [prepare, plan]
# Only run if check for existing release and asset failed.
if: ${{ needs.plan.outputs.check == 'fail' }}
Expand Down Expand Up @@ -162,6 +168,7 @@ jobs:
--log-level debug
--plan build-plan.yml
--native-full-aot
--no-self-sign
${{ inputs.build_args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
os:
description: GitHub Actions runner OS
type: string
required: true
required: false
default: "macos-11"
builder_ref:
description: Git ref to checkout of build-emacs-for-macos
required: false
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
os:
description: GitHub Actions runner OS
type: string
required: true
required: false
default: "macos-11"
plan_artifact:
description: Name of artifact containing a emacs-builder plan yaml file
type: string
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
description: 'Runner OS ("macos-11", "macos-12", or "macos-latest")'
required: true
default: "macos-11"
build_os:
description: "Build OS used to build Emacs"
required: false
default: "macos-11"
test_build_name:
description: "Test build name"
required: false
Expand All @@ -47,6 +51,7 @@ jobs:
uses: ./.github/workflows/_build.yml
with:
os: ${{ github.event.inputs.os }}
build_os: ${{ github.event.inputs.build_os }}
git_ref: ${{ github.event.inputs.git_ref }}
git_sha: ${{ github.event.inputs.git_sha }}
build_args: ${{ github.event.inputs.builder_args }}
Expand Down

0 comments on commit 40c7b2b

Please sign in to comment.