-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CI: Extract
.github/actions/compile-make
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
- Loading branch information
Showing
2 changed files
with
66 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Compile make | ||
description: compile-make | ||
inputs: | ||
version: | ||
description: make version | ||
required: true | ||
workaround: | ||
description: enable workaround for _alloc bug | ||
required: false | ||
default: "false" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Cache make compiled | ||
if: ${{ !startsWith(runner.os, 'windows') }} | ||
id: cache-maka | ||
uses: actions/cache@v4 | ||
with: | ||
path: /usr/local/bin/make-${{ inputs.version }} | ||
key: v1-${{ runner.os }}-make-${{ inputs.version }} | ||
|
||
# Compile it from source (temporarily) | ||
- name: Make GNU Make from source | ||
if: ${{ !startsWith(runner.os, 'windows') && steps.cache-make.outputs.cache-hit != 'true' }} | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
WORKAROUND: ${{ inputs.workaround }} | ||
shell: bash | ||
run: | | ||
curl "https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz" | tar xz | ||
pushd "make-${VERSION}" | ||
./configure | ||
[[ "$WORKAROUND" = "true" ]] && sed -i 's/#if !defined __alloca \&\& !defined __GNU_LIBRARY__/#if !defined __alloca \&\& defined __GNU_LIBRARY__/g; s/#ifndef __GNU_LIBRARY__/#ifdef __GNU_LIBRARY__/g' "./glob/glob.c" | ||
make -j 4 | ||
popd | ||
cp -p "make-${VERSION}/make" "/usr/local/bin/make-${VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters