Skip to content

Commit be048aa

Browse files
committed
ci: Try cross-compiling to aarch64-apple-darwin on GitHub Actions
1 parent fe21873 commit be048aa

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

.github/workflows/bump-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
bump-version:
1212
runs-on: ubuntu-18.04
1313
steps:
14-
- uses: purcell/setup-emacs@v3.0
14+
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
1515
with:
1616
version: '27.2'
1717
- uses: actions/checkout@v2

.github/workflows/main.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
# emacs-version: '27.2'
3636
- os: windows-2019
3737
emacs-version: '27.2'
38+
- os: macos-11
39+
emacs-version: '27.2'
40+
# Cross build
41+
target: aarch64-apple-darwin
3842
runs-on: ${{ matrix.os }}
3943
steps:
4044
- uses: actions/checkout@v2
@@ -43,7 +47,8 @@ jobs:
4347
- name: Install tree-sitter CLI
4448
run: npm install -g [email protected]
4549

46-
- uses: purcell/[email protected]
50+
# Using a specific commit hash to fix this https://github.com/purcell/setup-emacs/issues/24.
51+
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
4752
if: runner.os != 'Windows'
4853
with:
4954
version: ${{ matrix.emacs-version }}
@@ -62,13 +67,14 @@ jobs:
6267
- run: .github/script/setup-cask
6368
- run: cask install
6469

65-
- run: script/compile changed ${{ github.event.pull_request.base.sha }}
70+
- run: script/compile changed ${{ github.event.pull_request.base.sha }} -target "${{ matrix.target }}"
6671
if: github.event_name == 'pull_request'
67-
continue-on-error: true
68-
- run: script/compile all
72+
continue-on-error: ${{ !matrix.target }}
73+
- run: script/compile all -target "${{ matrix.target }}"
6974
if: github.event_name != 'pull_request'
70-
continue-on-error: true
75+
continue-on-error: ${{ !matrix.target }}
7176

7277
- run: script/inspect-binaries
7378
continue-on-error: true
7479
- run: script/test
80+
if: ${{ !matrix.target }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install tree-sitter CLI
3535
run: npm install -g [email protected]
3636

37-
- uses: purcell/setup-emacs@v3.0
37+
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
3838
if: runner.os != 'Windows'
3939
with:
4040
version: ${{ matrix.emacs-version }}
@@ -82,7 +82,7 @@ jobs:
8282
needs: build
8383
runs-on: ubuntu-18.04
8484
steps:
85-
- uses: purcell/setup-emacs@v3.0
85+
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
8686
with:
8787
version: '27.2'
8888
- uses: actions/checkout@v2

script/compile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ while [[ $# -gt 0 ]]; do
3535
esac
3636
done
3737
target=${target:-nil}
38-
if [ "$target" == '' ]; then
38+
if [ "$target" == "'" ]; then
3939
target=nil
4040
fi
4141

@@ -47,7 +47,7 @@ case $LANG in
4747
code="(tree-sitter-langs-compile-changed-or-all \"${2:-origin/master}\" $target)"
4848
;;
4949
(*)
50-
code="(tree-sitter-langs-compile '$LANG $target)"
50+
code="(tree-sitter-langs-compile '$LANG nil $target)"
5151
esac
5252

5353
(

script/inspect-binaries

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,23 @@ PROJECT_ROOT=$(cd "$here/.."; pwd)
1010

1111
case $system in
1212
(Linux)
13+
echo ┌─────────────────────────────────────────────────────────────────────
14+
echo └ Grammar binaries:
15+
file bin/*.so
1316
ldd bin/*.so
14-
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17+
echo ┌─────────────────────────────────────────────────────────────────────
18+
echo └ Emacs:
19+
file "$(which emacs)"
1520
ldd "$(which emacs)"
1621
;;
1722
(Darwin)
23+
echo ┌─────────────────────────────────────────────────────────────────────
24+
echo └ Grammar binaries:
25+
file bin/*.dylib
1826
otool -L bin/*.dylib
19-
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
echo ┌─────────────────────────────────────────────────────────────────────
28+
echo └ Emacs:
29+
file "$(which emacs)"
2030
otool -L "$(which emacs)"
2131
;;
2232
(*)

script/inspect-binaries.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# TODO Figure out how to reliably determine MSVC toolchain paths.
1+
echo "TODO Figure out how to reliably determine MSVC toolchain paths."

0 commit comments

Comments
 (0)