Skip to content

Commit

Permalink
GitHub actions (#66)
Browse files Browse the repository at this point in the history
GH CI
  • Loading branch information
yacekmm authored Apr 21, 2024
1 parent c9d43dd commit 8b28269
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-pricing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pricing CI
run-name: Pricing CI

on: [push]

env:
PACT_BROKER_BASE_URL: ${{ vars.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Publish Promoter Spring Cloud Contract
run: >-
cd services/Promoter &&
./gradlew publishToMavenLocal
- name: Test
run: >-
cd services/Pricing &&
./gradlew test
38 changes: 38 additions & 0 deletions .github/workflows/ci-promoter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Promoter CI
run-name: Promoter CI

on: [push]

env:
PACT_BROKER_BASE_URL: ${{ vars.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Publish Pricing Spring Cloud Contract
run: >-
cd services/Pricing &&
./gradlew publishToMavenLocal
- name: Test
run: >-
cd services/Promoter &&
./gradlew test
29 changes: 29 additions & 0 deletions .github/workflows/ci-shared-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: SharedLib CI
run-name: SharedLib CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Test
run: >-
cd libs/SharedLib &&
./gradlew test
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ KafkaReceiverVerifier messageReceiverVerifier() {
}

@Bean
@SuppressWarnings({"rawtypes"})
KafkaSenderVerifier messageSenderVerifier(KafkaTemplate kafkaTemplate) {
return new KafkaSenderVerifier(kafkaTemplate);
}
}

@Slf4j
@AllArgsConstructor
@SuppressWarnings({"rawtypes", "unchecked"})
class KafkaSenderVerifier implements MessageVerifierSender {

private KafkaTemplate kafkaTemplate;
Expand All @@ -69,6 +71,7 @@ public void send(Object message, String destination, @org.jetbrains.annotations.
}

@Slf4j
@SuppressWarnings({"rawtypes"})
class KafkaReceiverVerifier implements MessageVerifierReceiver<Message<?>> {

Map<String, BlockingQueue<Message<?>>> broker = new ConcurrentHashMap<>();
Expand Down

0 comments on commit 8b28269

Please sign in to comment.