AND-9484 Moved detekt to separate workflow #2
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: Tests | |
on: | |
pull_request: | |
branches: | |
- 'release' | |
- 'develop' | |
- 'master' | |
- 'hotfix/**' | |
- '*_pre_release' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test | |
runs-on: [ self-hosted, ARM64, active-android ] | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
token: ${{ secrets.GH_MOBILE_PAT }} | |
- name: Build Docker image | |
run: | | |
docker build --platform linux/arm64 -t tangem_ci_android_environment . | |
- name: Run detekt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
BUNDLE_PATH: vendor/bundle | |
run: | | |
docker run --rm \ | |
-e GITHUB_TOKEN \ | |
-e GITHUB_ACTOR \ | |
-e BUNDLE_PATH \ | |
-v ~/.gradle:/root/.gradle \ | |
-v ${{ github.workspace }}:/workspace \ | |
tangem_ci_android_environment \ | |
sh -c " | |
echo 'Running detekt...'; | |
cd /workspace && fastlane detekt; | |
" | |
- name: Build notification | |
if: failure() | |
uses: adamkdean/simple-slack-notify@master | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DVELOPMENT_ANDROID }} | |
with: | |
channel: '#development-android' | |
text: 'Detekt #${{ github.run_number }} failed' | |
color: 'danger' | |
fields: | | |
[{ "title": "Action URL", "value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}] |