blob: 07db25736a8cb6953ad24d107720bc23310958f2 [file] [log] [blame]
name: Validate
on:
pull_request:
push:
branches:
- master
jobs:
gradle-wrapper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Run Lint
run: ./gradlew lintDebug
- name: Zip reports
if: always()
run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.html'
- name: Upload reports
if: always()
uses: actions/upload-artifact@v2
with:
name: lint_reports
path: reports.zip
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest
- name: Zip reports
if: always()
run: zip -r reports.zip . -i '**/reports/*.xml' '**/reports/*.html'
- name: Upload reports
if: always()
uses: actions/upload-artifact@v2
with:
name: unit_test_reports
path: reports.zip
deploy:
if: github.event_name == 'push' && github.repository == 'airbnb/lottie-android' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [lint, unit-test]
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
- name: "Deploy Snapshot"
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: ./deploy_snapshot.sh