diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 05f5adf..0000000 --- a/.github/main.workflow +++ /dev/null @@ -1,37 +0,0 @@ -workflow "Build, Test and Distribute" { - on = "push" - resolves = "Publish Code Coverage" -} - -action "Build" { - uses = "vgaidarji/android-github-actions/build@v1.0.0" - secrets = ["FABRIC_API_KEY", "FABRIC_API_SECRET"] - args = "./gradlew assembleDebug -PpreDexEnable=false" -} - -action "Check" { - needs = ["Build"] - uses = "vgaidarji/android-github-actions/build@v1.0.0" - secrets = ["FABRIC_API_KEY", "FABRIC_API_SECRET"] - args = "./gradlew testDebug jacocoTestReport checkstyle pmd jdepend lintDebug buildDashboard -PpreDexEnable=false" -} - -action "Run UI Tests" { - needs = ["Build"] - secrets = ["FABRIC_API_KEY", "FABRIC_API_SECRET"] - uses = "vgaidarji/android-github-actions/emulator@v1.0.0" -} - -action "Distribute" { - needs = ["Check", "Run UI Tests"] - uses = "vgaidarji/android-github-actions/build@v1.0.0" - secrets = ["FABRIC_API_KEY", "FABRIC_API_SECRET"] - args = "./gradlew crashlyticsUploadDistributionDebug -PpreDexEnable=false" -} - -action "Publish Code Coverage" { - needs = ["Distribute"] - uses = "vgaidarji/android-github-actions/build@v1.0.0" - secrets = ["COVERALLS_REPO_TOKEN"] - args = "./gradlew coveralls -PpreDexEnable=false" -} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..6675935 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,48 @@ +name: Build, Test and Distribute +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Build + uses: vgaidarji/android-github-actions-build@v1.0.1 + env: + FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }} + FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }} + with: + args: "sdkmanager 'platforms;android-26' && ./gradlew assembleDebug -PpreDexEnable=false" + - name: Check + uses: vgaidarji/android-github-actions-build@v1.0.1 + env: + FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }} + FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }} + with: + args: "./gradlew testDebug jacocoTestReport checkstyle pmd jdepend lintDebug buildDashboard -PpreDexEnable=false" + - name: Distribute + uses: vgaidarji/android-github-actions-build@v1.0.1 + env: + FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }} + FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }} + with: + args: "./gradlew crashlyticsUploadDistributionDebug -PpreDexEnable=false" + - name: Publish Code Coverage + uses: vgaidarji/android-github-actions-build@v1.0.1 + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + with: + args: "./gradlew coveralls -PpreDexEnable=false" + androidTest: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Instrumentation Tests + uses: reactivecircus/android-emulator-runner@v2 + env: + FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }} + FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }} + with: + api-level: 29 + arch: x86 + disable-animations: true + script: ./gradlew connectedAndroidTest --stacktrace