Comment out a badge #354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- compose | |
jobs: | |
test: | |
name: Test the project | |
# Should be macos (https://github.com/marketplace/actions/android-emulator-runner) | |
runs-on: macos-latest | |
steps: | |
- name: Checkout the code | |
id: step1 | |
uses: actions/checkout@v2 | |
# See https://developer.android.com/studio/test/command-line for test types and their result location | |
- name: Set up a specific Java version | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" # OR adopt OR microsoft OR... | |
java-version: "11" | |
- name: Run all unit tests | |
run: ./gradlew :piechart:test --stacktrace | |
- name: Run all instrumentation tests | |
id: step2 | |
if: always() # Run even if the previous steps failed | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
target: google_apis | |
arch: x86_64 | |
profile: Nexus 5X # This is important for screenshot tests because of screen resolution and DPI | |
script: ./gradlew :piechart:connectedAndroidTest --stacktrace | |
disable-animations: false | |
- name: Upload test reports | |
if: always() # Run even if the previous steps failed | |
uses: actions/upload-artifact@v2 | |
with: | |
name: tests-report | |
path: | | |
piechart/build/reports/tests/ | |
piechart/build/reports/androidTests/connected/ | |
- name: Upload coverage report | |
if: ${{ steps.step1.conclusion == 'success' && steps.step2.conclusion == 'success' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage-report | |
path: piechart/build/reports/coverage/debug | |
- name: Download coverage report | |
if: ${{ steps.step1.conclusion == 'success' && steps.step2.conclusion == 'success' }} | |
uses: actions/download-artifact@v2 | |
with: | |
name: coverage-report | |
path: piechart/build/reports/coverage/debug | |
- name: Send the report to Codecov | |
if: ${{ steps.step1.conclusion == 'success' && steps.step2.conclusion == 'success' }} | |
run: bash <(curl -s https://codecov.io/bash) -f "piechart/build/reports/coverage/debug/report.xml" | |
generate-lint: | |
name: Create lint report | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Run lint | |
run: ./gradlew :piechart:lintDebug --stacktrace | |
- name: Upload the html report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lint-report | |
path: piechart/build/reports/lint-results-debug.html |