2021-07-24 13:23:03 -07:00
|
|
|
name: Android
|
2020-07-02 19:30:53 -07:00
|
|
|
|
2023-11-25 17:36:24 -08:00
|
|
|
#on: [push,pull_request]
|
|
|
|
on: [workflow_dispatch]
|
2020-07-02 19:30:53 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-05 06:09:12 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-01-29 01:43:27 -08:00
|
|
|
|
|
|
|
- name: Checkout Submodules
|
|
|
|
run: |
|
|
|
|
git submodule update --init --depth=1 unit_tests/googletest
|
|
|
|
git submodule update --init --depth=1 firmware/libfirmware
|
|
|
|
git submodule update --init --depth=1 firmware/ext/lua
|
|
|
|
git submodule update --init --depth=1 firmware/controllers/lua/luaaa
|
|
|
|
git submodule update --init --depth=1 firmware/controllers/can/wideband_firmware
|
|
|
|
|
2023-11-30 00:06:18 -08:00
|
|
|
- uses: actions/setup-java@v4
|
2020-07-02 19:30:53 -07:00
|
|
|
with:
|
2022-07-28 01:00:13 -07:00
|
|
|
distribution: 'zulu'
|
2023-06-17 20:32:21 -07:00
|
|
|
java-version: '11'
|
2020-07-02 19:30:53 -07:00
|
|
|
|
2022-08-27 11:51:41 -07:00
|
|
|
- name: Install Tools
|
2023-01-13 02:35:59 -08:00
|
|
|
run: |
|
2023-02-25 15:07:31 -08:00
|
|
|
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
|
2023-01-13 02:35:59 -08:00
|
|
|
sudo apt-get install mtools
|
2022-08-27 11:51:41 -07:00
|
|
|
|
2022-08-31 17:53:17 -07:00
|
|
|
- name: Generate Configs, Enums & Live Documentation
|
2022-08-27 11:26:31 -07:00
|
|
|
working-directory: ./firmware/
|
2022-08-31 17:53:17 -07:00
|
|
|
run: ./gen_default_everything.sh
|
2022-08-27 11:26:31 -07:00
|
|
|
|
2023-11-04 06:15:17 -07:00
|
|
|
- name: Test Java Compiler
|
2020-07-02 19:30:53 -07:00
|
|
|
run: javac -version
|
|
|
|
|
2022-03-12 21:25:10 -08:00
|
|
|
- name: Print GCC version
|
|
|
|
working-directory: .
|
|
|
|
run: gcc -v
|
|
|
|
|
|
|
|
- name: Build Native Unit Tests as shared library
|
|
|
|
working-directory: ./unit_tests/
|
|
|
|
# we have a unit test of JNI thus we need to build shared library
|
2022-07-26 23:22:22 -07:00
|
|
|
run: make -j4 SANITIZE=no build/lib_rusefi_test
|
2022-03-12 21:25:10 -08:00
|
|
|
|
2020-07-02 20:02:10 -07:00
|
|
|
- name: Build Android
|
2020-08-16 12:50:41 -07:00
|
|
|
env:
|
|
|
|
RUSEFI_ANDROID_KEYPASS: ${{ secrets.RUSEFI_ANDROID_KEYPASS }}
|
2020-07-02 19:30:53 -07:00
|
|
|
working-directory: ./android
|
2020-08-21 20:16:55 -07:00
|
|
|
run: |
|
2023-09-27 20:39:42 -07:00
|
|
|
if [ "${{github.repository}}" == "rusefi/rusefi" && "${{github.event_name}}" == "push" ]; then
|
2020-08-21 20:16:55 -07:00
|
|
|
bash ./gradlew build
|
|
|
|
else
|
2022-07-22 05:26:04 -07:00
|
|
|
bash ./gradlew bundleDebug test
|
2020-08-21 20:16:55 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload APK - release
|
|
|
|
if: ${{ github.event_name == 'push' }}
|
2022-07-27 10:10:58 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-08-21 20:16:55 -07:00
|
|
|
with:
|
|
|
|
name: rusEFI-release
|
|
|
|
path: ./android/app/build/outputs/apk/release/rusEFI-release.apk
|
2020-07-02 20:02:10 -07:00
|
|
|
|
2020-08-21 20:16:55 -07:00
|
|
|
- name: Upload APK - unsigned
|
|
|
|
if: ${{ github.event_name != 'push' }}
|
2022-07-27 10:10:58 -07:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-07-02 20:02:10 -07:00
|
|
|
with:
|
2020-07-02 20:10:25 -07:00
|
|
|
name: rusEFI-release-unsigned
|
2020-08-21 20:16:55 -07:00
|
|
|
path: ./android/app/build/outputs/bundle/debug/rusEFI-debug.aab
|
2020-08-15 20:58:29 -07:00
|
|
|
|
2020-08-15 21:02:38 -07:00
|
|
|
- name: Install Tools
|
2021-10-25 05:22:31 -07:00
|
|
|
run: sudo apt-get install sshpass
|
2020-08-15 21:02:38 -07:00
|
|
|
|
2020-08-15 20:58:29 -07:00
|
|
|
- name: Upload rusEFI Android application
|
2020-08-21 20:16:55 -07:00
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
2020-08-15 20:58:29 -07:00
|
|
|
working-directory: .
|
2021-12-22 17:25:28 -08:00
|
|
|
run: java_console/upload_file.sh ${{ secrets.RUSEFI_SSH_USER }} ${{ secrets.RUSEFI_SSH_PASS }} ${{ secrets.RUSEFI_SSH_SERVER }} build_server android/app/build/outputs/apk/release/rusEFI-release.apk
|