Skip to content

KON-583 Add possibility to create scope passing sets of items #1184

KON-583 Add possibility to create scope passing sets of items

KON-583 Add possibility to create scope passing sets of items #1184

name: Check Starter Projects
on:
pull_request:
types: [ opened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-github-context:
name: Get GitHub Context
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: List Branches
run: |
echo current branch: ${{ steps.branch-name.outputs.current_branch }}
echo base ref branch: ${{ steps.branch-name.outputs.base_ref_branch }}
echo default branch: ${{ steps.branch-name.outputs.default_branch }}
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v42.0.2
- name: List Changed Files
run: |
echo Changed files:
echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ' ' '\n'
- name: Echo Run Condition (any true to run)
run: |
echo Current branch starts with "release/": ${{ startsWith(steps.branch-name.outputs.current_branch, 'release/') }}
echo Current branch starts with "renovate/": ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }}
echo Current branch contains "starter-projects": ${{ contains(steps.branch-name.outputs.current_branch, 'starter-projects') }}
echo Base ref branch is "main": ${{ steps.branch-name.outputs.base_ref_branch == 'main' }}
echo Changed files in the "samples/starter-projects/" directory: ${{ contains(steps.changed-files.outputs.all_changed_files, 'samples/starter-projects/') }}
outputs:
current_branch: ${{ steps.branch-name.outputs.current_branch }}
base_ref_branch: ${{ steps.branch-name.outputs.base_ref_branch }}
default_branch: ${{ steps.branch-name.outputs.default_branch }}
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
head_commit_message: ${{ github.event.head_commit.message }}
konsist-starter-android-gradle-groovy-junit-4:
name: Konsist Starter Android Gradle Groovy Junit 4
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-groovy-junit-4/settings.gradle
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-groovy-junit-4/konsistTest/build.gradle
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-groovy-junit-4/ && ./gradlew konsistTest:test
konsist-starter-android-gradle-groovy-junit-5:
name: Konsist Starter Android Gradle Groovy Junit 5
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-groovy-junit-5/settings.gradle
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-groovy-junit-5/konsistTest/build.gradle
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-groovy-junit-5/ && ./gradlew konsistTest:test
konsist-starter-android-gradle-groovy-kotest:
name: Konsist Starter Android Gradle Groovy Kotest
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-groovy-kotest/settings.gradle
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-groovy-kotest/konsistTest/build.gradle
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-groovy-kotest/ && ./gradlew konsistTest:test
konsist-starter-android-gradle-kotlin-junit-4:
name: Konsist Starter Android Gradle Kotlin Junit 4
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-4/settings.gradle.kts
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-4/konsistTest/build.gradle.kts
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-4/ && ./gradlew konsistTest:test
konsist-starter-android-gradle-kotlin-junit-5:
name: Konsist Starter Android Gradle Kotlin Junit 5
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-5/settings.gradle.kts
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-5/konsistTest/build.gradle.kts
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-kotlin-junit-5/ && ./gradlew konsistTest:test
konsist-starter-android-gradle-kotlin-kotest:
name: Konsist Starter Android Gradle Kotlin Kotest
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-android-gradle-kotlin-kotest/settings.gradle.kts
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-android-gradle-kotlin-kotest/konsistTest/build.gradle.kts
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-android-gradle-kotlin-kotest/ && ./gradlew konsistTest:test
konsist-starter-spring-gradle-kotlin-junit-5:
name: Konsist Starter Spring Gradle Kotlin Junit 5
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-gradle-kotlin-junit-5/build.gradle.kts
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-gradle-kotlin-junit-5/build.gradle.kts
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-gradle-kotlin-junit-5/ && ./gradlew konsistTest
konsist-starter-spring-gradle-kotlin-kotest:
name: Konsist Starter Spring Gradle Groovy Kotest
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-gradle-kotlin-kotest/build.gradle.kts
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-gradle-kotlin-kotest/build.gradle.kts
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-gradle-kotlin-kotest/ && ./gradlew konsistTest
konsist-starter-spring-gradle-groovy-junit-5:
name: Konsist Starter Spring Gradle Groovy Junit 5
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-gradle-groovy-junit-5/build.gradle
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-gradle-groovy-junit-5/build.gradle
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-gradle-groovy-junit-5/ && ./gradlew konsistTest
konsist-starter-spring-gradle-groovy-kotest:
name: Konsist Starter Spring Gradle Groovy Kotest
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-gradle-groovy-kotest/build.gradle
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-gradle-groovy-kotest/build.gradle
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-gradle-groovy-kotest/ && ./gradlew konsistTest
konsist-starter-spring-maven-junit5:
name: Konsist Starter Spring Maven Junit 5
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-maven-junit5/pom.xml
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-maven-junit5/pom.xml
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-maven-junit5/ && mvn test
konsist-starter-spring-maven-kotest:
name: Konsist Starter Spring Maven Kotest
needs: get-github-context
runs-on: ubuntu-latest
if: |
startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
needs.get-github-context.outputs.base_ref_branch == 'main' ||
contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.3'
- name: Add Maven Local Repository
run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-spring-maven-kotest/pom.xml
- name: Replace Konsist Version
run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-spring-maven-kotest/pom.xml
- name: Publish Konsist Artifact To Local Maven Repository
run: >
./gradlew publishToMavenLocal
- name: Run Konsist Test
run: cd samples/starter-projects/konsist-starter-spring-maven-kotest/ && mvn test
# konsist-starter-kmp-gradle-kotlin-junit5:
# name: Konsist Starter KMP Gradle Kotlin Junit 5
# needs: get-github-context
# runs-on: ubuntu-latest
# if: |
# startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
# startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
# contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
# needs.get-github-context.outputs.base_ref_branch == 'main' ||
# contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set up JDK
# uses: actions/setup-java@v3
# with:
# java-version: 21
# distribution: 'corretto'
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.11.3'
#
# - name: Add Maven Local Repository
# run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-kmp-gradle-kotlin-junit5/build.gradle.kts
#
# - name: Replace Konsist Version
# run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-kmp-gradle-kotlin-junit5/build.gradle.kts
#
# - name: Publish Konsist Artifact To Local Maven Repository
# run: >
# ./gradlew publishToMavenLocal
#
# - name: Run Konsist Test
# run: cd samples/starter-projects/konsist-starter-kmp-gradle-kotlin-junit5/ && ./gradlew test
# konsist-starter-kmp-gradle-kotlin-kotest:
# name: Konsist Starter KMP Gradle Kotlin Kotest
# needs: get-github-context
# runs-on: ubuntu-latest
# if: |
# startsWith(needs.get-github-context.outputs.current_branch, 'release/') ||
# startsWith(needs.get-github-context.outputs.current_branch, 'renovate/') ||
# contains(needs.get-github-context.outputs.current_branch, 'starter-projects') ||
# needs.get-github-context.outputs.base_ref_branch == 'main' ||
# contains(needs.get-github-context.outputs.all_changed_files, 'samples/starter-projects/')
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set up JDK
# uses: actions/setup-java@v3
# with:
# java-version: 21
# distribution: 'corretto'
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.11.3'
#
# - name: Add Maven Local Repository
# run: python3 scripts/replace_konsist_version/add_maven_local_repository_to_config_file.py samples/starter-projects/konsist-starter-kmp-gradle-kotlin-kotest/build.gradle.kts
#
# - name: Replace Konsist Version
# run: python3 scripts/replace_konsist_version/replace_konsist_version_gradle_groovy.py samples/starter-projects/konsist-starter-kmp-gradle-kotlin-kotest/build.gradle.kts
#
# - name: Publish Konsist Artifact To Local Maven Repository
# run: >
# ./gradlew publishToMavenLocal
#
# - name: Run Konsist Test
# run: cd samples/starter-projects/konsist-starter-kmp-gradle-kotlin-kotest/ && ./gradlew test