mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
123 lines
3.6 KiB
YAML
123 lines
3.6 KiB
YAML
name: Build and test
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "colorschemes" ]
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'fastlane/**'
|
|
- '.github/workflows/crowdin_contributors.yml'
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'fastlane/**'
|
|
- '.github/workflows/crowdin_contributors.yml'
|
|
workflow_dispatch: {}
|
|
|
|
jobs:
|
|
build_apk:
|
|
name: Build APK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Cancel previous runs
|
|
uses: styfle/cancel-workflow-action@0.11.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- name: Change Gradle wrapper permissions
|
|
run: chmod +x ./gradlew
|
|
- name: Restore cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
- name: Assemble Debug
|
|
run: ./gradlew assembleDebug
|
|
env:
|
|
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
|
|
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
|
|
IDE_SIGNING_AUTH_USER: ${{ secrets.IDE_SIGNING_AUTH_USER }}
|
|
IDE_SIGNING_KEY_PASS: ${{ secrets.IDE_SIGNING_KEY_PASS }}
|
|
IDE_SIGNING_STORE_PASS: ${{ secrets.IDE_SIGNING_STORE_PASS }}
|
|
IDE_SIGNING_URL: ${{ secrets.IDE_SIGNING_URL }}
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: apk-debug
|
|
path: app/build/outputs/apk/debug/**.apk
|
|
|
|
unit_test_debug:
|
|
name: Run local tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- name: Change Gradle wrapper permissions
|
|
run: chmod +x ./gradlew
|
|
- name: Restore cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
- name: Run debug tests
|
|
run: ./gradlew testDebug --continue
|
|
- name: Upload Test Reports
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: test-reports
|
|
path: '**/build/reports/tests/'
|
|
|
|
test_tooling_api:
|
|
name: Test Tooling API implementation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- name: Change Gradle wrapper permissions
|
|
run: chmod +x ./gradlew
|
|
- name: Restore cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
- name: Run Tooling API tests
|
|
run: ./gradlew :subprojects:tooling-api-impl:test --continue
|
|
env:
|
|
TEST_TOOLING_API_IMPL: "true"
|
|
- name: Upload Test Reports
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: tooling-api-test-reports
|
|
path: 'subprojects/tooling-api-impl/build/reports/tests/'
|