mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 14:07:05 +05:30
97 lines
2.4 KiB
YAML
97 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- renovate/**
|
|
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
run-unit-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3.0.2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v3.2.0
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- name: Copy CI gradle.properties
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
- name: Run unit tests
|
|
uses: gradle/gradle-build-action@v2.1.5
|
|
with:
|
|
arguments: testDebug --stacktrace --no-configuration-cache
|
|
|
|
- name: (Fail-only) Upload test report
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3.0.0
|
|
with:
|
|
name: Test report
|
|
path: android/build/reports
|
|
|
|
stylecheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3.0.2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v3.2.0
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- name: Copy CI gradle.properties
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
- name: Check codestyle with Spotless
|
|
uses: gradle/gradle-build-action@v2.1.5
|
|
with:
|
|
arguments: spotlessCheck --no-configuration-cache
|
|
|
|
deploy-release-snapshot:
|
|
runs-on: ubuntu-latest
|
|
if: "github.event_name == 'push' && github.event.ref == 'refs/heads/main'"
|
|
needs: [ "run-unit-tests", "stylecheck" ]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3.0.2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v3.2.0
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- name: Copy CI gradle.properties
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
- name: Decrypt secrets
|
|
run: scripts/signing-setup.sh "$ENCRYPT_KEY"
|
|
env:
|
|
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
|
|
|
|
- name: Build release app
|
|
uses: gradle/gradle-build-action@v2.1.5
|
|
with:
|
|
arguments: collectReleaseApks --no-configuration-cache
|
|
|
|
- name: Clean secrets
|
|
run: scripts/signing-cleanup.sh
|
|
|
|
- name: Deploy snapshot
|
|
run: scripts/deploy-snapshot.sh
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|