Skip to content

Commit

Permalink
Add CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
udenr committed Oct 25, 2023
1 parent 23ee706 commit b865a24
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Android Emulator Tests
on: [push, pull_request]

jobs:
check-if-tests-exist:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.check-androidTest.outputs.NOT_EMPTY }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Check if androidTest folder is not empty
run: |
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')"
echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
id: check-androidTest
test:
needs: check-if-tests-exist
if: needs.check-if-tests-exist.outputs.status == 'true'
runs-on: macos-latest
strategy:
matrix:
api-level: [29]
target: [default]
arch: [x86_64]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: Run connected tests
uses: ReactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Nexus 6
disable-animations: true
script: ./gradlew :BackupAPI:connectedCheck --stacktrace
1 change: 0 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
- uses: rhysd/changelog-from-release/action@v3
with:
file: CHANGELOG.md
pull_request: true
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_summary_template: 'update changelog for %s changes'
args: -l 2
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Continuous Integration
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run local unit tests
run: bash ./gradlew test --stacktrace

build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build the app
run: bash ./gradlew build --stacktrace

0 comments on commit b865a24

Please sign in to comment.