Open4
actを使用してローカルでAndroid PJのworkflowを動かす
最初に
ローカルでGithub Actionsのワークフローを実行できるact
を試す
環境
M1 chip mac OS Ventura 13.4.1
Docker for mac desktop 4.21.1 (114176)
act 0.2.46
必要だったaction
yamlファイル
name: build
run-name: Build 🔄
on:
pull_request:
branches: [ main ]
jobs:
build_jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'zulu'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Grant execute permissions for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
-
actを以下のコマンドで実行
act pull_request --env-file .env
-
結果
/run/act/actions/android-actions-setup-android@v2/dist/index.js:3546
| throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
| ^
|
| Error: Unable to locate executable file: unzip. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
| at Object.<anonymous> (/run/act/actions/android-actions-setup-android@v2/dist/index.js:3546:27)
| at Generator.next (<anonymous>)
| at fulfilled (/run/act/actions/android-actions-setup-android@v2/dist/index.js:3357:58)
関連のありそうなissueあるけど更新なし
結果
actの docker-imageがMicro
に設定されていたため最小限のツールしか搭載されていなかったのが原因
解決方法
- ~./actrcを削除
- 再度
act --container-architecture linux/amd64
コマンドをたたいて実行 - mediumを選択
※ .env
の設定は不要でした