-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom key for cache #182
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
sdk: [32, 33] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.sdk }}-test | ||
|
@@ -52,7 +52,7 @@ jobs: | |
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-test_not_use_cache | ||
cancel-in-progress: true | ||
|
@@ -91,7 +91,7 @@ jobs: | |
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -116,3 +116,35 @@ jobs: | |
|
||
- run: | | ||
sdkmanager --install "system-images;android-31;default;x86_64" | ||
|
||
test_custom_cache_key: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 |
||
name: run test custom cache key | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: remove android sdk from ubuntu-latest | ||
shell: bash | ||
run: | | ||
echo 'ANDROID_HOME=' >> $GITHUB_ENV | ||
echo 'ANDROID_SDK_ROOT=' >> $GITHUB_ENV | ||
rm -rf ~/android | ||
|
||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Setup Android SDK | ||
uses: ./ | ||
with: | ||
cache-key: 'default-version' | ||
|
||
- run: | | ||
sdkmanager --install emulator |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
# setup-android | ||
|
||
This action provides the following functionality for GitHub Actions users: | ||
This action provides the following functionality for GitHub Actions users: | ||
|
||
- Optionally downloading and caching distribution of the requested sdk version or build tools version or ndk,cmake version, and adding it to the PATH | ||
- Runs on Mac, Linux and Windows powered by SelfHostedRunner | ||
|
||
# Motivation | ||
|
||
This Action is provided for SelfHostedRunner. | ||
GithubHostedRunner does not need this Action as it already has the SDK set up. | ||
|
||
|
@@ -14,6 +15,7 @@ GithubHostedRunner does not need this Action as it already has the SDK set up. | |
See [action.yml](action.yml) | ||
|
||
**Basic:** | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -22,14 +24,15 @@ steps: | |
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Setup Android SDK | ||
uses: amyu/setup-android@v3 | ||
|
||
- run: ./gradlew build --stacktrace | ||
``` | ||
|
||
**Additional:** | ||
|
||
```yaml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -38,26 +41,30 @@ steps: | |
with: | ||
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Setup Android SDK | ||
uses: amyu/setup-android@v3 | ||
with: | ||
# default: false | ||
# Whether to use the cache | ||
# Whether to use the cache | ||
cache-disabled: true | ||
|
||
|
||
# default: `${sdkVersion}-${buildToolsVersion}-${ndkVersion}-${cmakeVersion}-v3.1` | ||
# Custom key for cache. It is invalid when `cache-disabled: true` | ||
cache-key: 'custom-cache-key' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
# default: '33' | ||
# sdk version | ||
# see https://developer.android.com/studio/releases/platforms | ||
# It will always be installed. | ||
sdk-version: '33' | ||
|
||
# default: '33.0.2' | ||
# build tools version | ||
# see https://developer.android.com/studio/releases/build-tools | ||
# It will always be installed. | ||
build-tools-version: '33.0.2' | ||
|
||
# default: '' | ||
# cmake version | ||
# see https://developer.android.com/studio/projects/install-ndk | ||
|
@@ -71,7 +78,7 @@ steps: | |
ndk-version: '23.1.7779620' | ||
|
||
# default: true | ||
# Whether to generate or not the job summary | ||
# Whether to generate or not the job summary | ||
generate-job-summary: false | ||
|
||
- run: ./gradlew build --stacktrace | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ inputs: | |
required: false | ||
description: 'disabled cache' | ||
default: 'false' | ||
cache-key: | ||
required: false | ||
description: 'cache key' | ||
default: '' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 |
||
generate-job-summary: | ||
required: false | ||
description: 'display job summary' | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"name": "setup-android", | ||
"version": "2", | ||
"version": "3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 👍 👍 👍 👍 👍 👍 |
||
"description": "setup-android for self hosted runner", | ||
"main": "dist/setup/index.js", | ||
"scripts": { | ||
"postinstall": "patch-package", | ||
"build": "tsc", | ||
"format": "prettier --write '**/*.ts'", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding quotes, cannot be executed on Windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 👍 👍 👍 👍 |
||
"format-check": "prettier --check '**/*.ts'", | ||
"format": "prettier --write **/*.ts", | ||
"format-check": "prettier --check **/*.ts", | ||
"lint": "eslint src/**/*.ts", | ||
"package": "ncc build -o dist/setup src/setup-android.ts && ncc build -o dist/cleanup src/cleanup-android.ts", | ||
"all": "npm run postinstall && npm run build && npm run format && npm run lint && npm run package" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is formatted by prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks reformat!