Skip to content

Commit a6aae87

Browse files
authored
Merge pull request #497 from nttld/android-sdk
Add option to symlink to Android SDK
2 parents ec9f304 + 1fa2a05 commit a6aae87

File tree

10 files changed

+528
-39
lines changed

10 files changed

+528
-39
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
os: [ubuntu-latest, windows-latest, macos-latest]
29-
ndk-version: [r21e, r25b]
29+
ndk-version: [r21e, r25c]
3030
local-cache: [true, false]
3131

3232
runs-on: ${{ matrix.os }}
@@ -37,10 +37,16 @@ jobs:
3737
with:
3838
ndk-version: ${{ matrix.ndk-version }}
3939
local-cache: ${{ matrix.local-cache }}
40+
link-to-sdk: true
4041

4142
- run: ndk-build --version
4243
- run: ${{ steps.install-ndk.outputs.ndk-path }}/ndk-build --version
4344

45+
- run: $ANDROID_HOME/ndk/${{ steps.install-ndk.outputs.ndk-full-version }}/ndk-build --version
46+
if: matrix.os != 'windows-latest'
47+
- run: "& $Env:ANDROID_HOME/ndk/${{ steps.install-ndk.outputs.ndk-full-version }}/ndk-build --version"
48+
if: matrix.os == 'windows-latest'
49+
4450
test-multiple:
4551
runs-on: ubuntu-latest
4652
strategy:
@@ -58,7 +64,7 @@ jobs:
5864
- uses: ./
5965
id: install-ndk-25
6066
with:
61-
ndk-version: r25b
67+
ndk-version: r25c
6268
add-to-path: false
6369
local-cache: ${{ matrix.local-cache }}
6470

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# setup-ndk
22

3-
![test status](https://github.com/nttld/setup-ndk/actions/workflows/test.yml/badge.svg)
4-
5-
This action sets up an Android NDK environment by downloading and caching a version of the NDK and adding it to the PATH
3+
This action sets up an Android NDK environment by downloading and caching a version of the NDK and optionally adding it to the PATH and linking it to the Android SDK.
64

75
## Usage
86

@@ -12,18 +10,18 @@ See [action.yml](action.yml)
1210

1311
```yml
1412
steps:
15-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1614
- uses: nttld/setup-ndk@v1
1715
with:
18-
ndk-version: r25b
16+
ndk-version: r25c
1917
- runs: ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk
2018
```
2119
2220
### Using the installation path
2321
2422
```yml
2523
steps:
26-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v3
2725
- uses: nttld/setup-ndk@v1
2826
id: setup-ndk
2927
with:
@@ -34,13 +32,26 @@ steps:
3432
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
3533
```
3634
37-
### Caching locally
35+
### Linking to the SDK
36+
37+
```yml
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: nttld/setup-ndk@v1
41+
id: setup-ndk
42+
with:
43+
ndk-version: r25c
44+
link-to-sdk: true
45+
- run: ./gradlew build
46+
```
47+
48+
### Caching locally for the workflow
3849
3950
```yml
4051
steps:
41-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
4253
- uses: nttld/setup-ndk@v1
4354
with:
44-
ndk-version: r25b
55+
ndk-version: r21e
4556
local-cache: true
4657
```

action.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Setup Android NDK
22
description: Setup an Android NDK environment by downloading and optionally caching it and adding it to the PATH
33
author: Raphaël Thériault
4+
branding:
5+
icon: play
6+
color: green
7+
48
inputs:
59
ndk-version:
610
description: Exact version to use
@@ -9,16 +13,20 @@ inputs:
913
description: Add installation directory to the PATH
1014
required: false
1115
default: "true"
16+
link-to-sdk:
17+
description: Add installed NDK to the Android SDK
18+
required: false
19+
default: "false"
1220
local-cache:
1321
description: Use the local job cache on top of the runner tool cache
1422
required: false
1523
default: "false"
1624
outputs:
1725
ndk-path:
1826
description: Installation path
27+
ndk-full-version:
28+
description: Full NDK version
29+
1930
runs:
2031
using: node16
2132
main: dist/index.js
22-
branding:
23-
icon: play
24-
color: green

0 commit comments

Comments
 (0)