|
| 1 | +definitions: |
| 2 | + configure_environment: &configure_environment |
| 3 | + instance_type: mac_mini_m1 |
| 4 | + max_build_duration: 30 |
| 5 | + cache: |
| 6 | + cache_paths: |
| 7 | + - $HOME/.gradle/caches |
| 8 | + scripts: |
| 9 | + - &detekt_on_template_compose |
| 10 | + name: Run detekt on template-compose |
| 11 | + working_directory: ./template-compose |
| 12 | + script: ./gradlew detekt |
| 13 | + - &detekt_on_template_xml |
| 14 | + name: Run detekt on template-xml |
| 15 | + working_directory: ./template-xml |
| 16 | + script: ./gradlew detekt |
| 17 | + - &unit_test_on_template_compose |
| 18 | + name: Run unit tests on template-compose |
| 19 | + working_directory: ./template-compose |
| 20 | + script: ./gradlew koverMergedReport |
| 21 | + - &unit_test_on_template_xml |
| 22 | + name: Run unit tests on template-xml |
| 23 | + working_directory: ./template-xml |
| 24 | + script: ./gradlew koverMergedReport |
| 25 | + artifacts: |
| 26 | + - &artifacts_template_compose template-compose/build/reports/kover/merged/ |
| 27 | + - &artifacts_template_xml template-xml/build/reports/kover/merged/ |
| 28 | +workflows: |
| 29 | + unit-test-on-pr-for-template-compose: |
| 30 | + name: Unit test on PR for template-compose |
| 31 | + <<: *configure_environment |
| 32 | + triggering: |
| 33 | + events: |
| 34 | + # run when a pull request is opened or updated |
| 35 | + - pull_request |
| 36 | + branch_patterns: |
| 37 | + # review changes BEFORE they’re merged into any branches |
| 38 | + - pattern: '*' |
| 39 | + source: false |
| 40 | + # review changes AFTER they have been merged into develop branch |
| 41 | + - pattern: 'develop' |
| 42 | + # review changes AFTER they have been merged into main branch |
| 43 | + - pattern: 'main' |
| 44 | + cancel_previous_builds: true |
| 45 | + scripts: |
| 46 | + - *detekt_on_template_compose |
| 47 | + - *unit_test_on_template_compose |
| 48 | + artifacts: |
| 49 | + - *artifacts_template_compose |
| 50 | + |
| 51 | + unit-test-on-pr-for-template-xml: |
| 52 | + name: Unit test on PR for template-xml |
| 53 | + <<: *configure_environment |
| 54 | + triggering: |
| 55 | + events: |
| 56 | + # run when a pull request is opened or updated |
| 57 | + - pull_request |
| 58 | + branch_patterns: |
| 59 | + # review changes BEFORE they’re merged into any branches |
| 60 | + - pattern: '*' |
| 61 | + source: false |
| 62 | + # review changes AFTER they have been merged into develop branch |
| 63 | + - pattern: 'develop' |
| 64 | + # review changes AFTER they have been merged into main branch |
| 65 | + - pattern: 'main' |
| 66 | + cancel_previous_builds: true |
| 67 | + scripts: |
| 68 | + - *detekt_on_template_xml |
| 69 | + - *unit_test_on_template_xml |
| 70 | + artifacts: |
| 71 | + - *artifacts_template_xml |
0 commit comments