Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#40): Migrate to 'thriving-dev/java-library-template' CICD #43

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "🐞 Bug report"
description: Create a report to help us improve
labels: ["pending triage"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out this bug report!

Please carefully read the contribution docs before creating a bug report
👉 https://github.com/thriving-dev/kafka-streams-cassandra-state-store/blob/main/CONTRIBUTING.md
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. What is the current behaviour vs. what do you expect to happen? If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: input
id: version
attributes:
label: Library version(s) affected
description: What library version did you experience this bug with? Which versions are affected (when known)?
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Please describe how we can reproduce the behavior.
- type: textarea
id: additonal
attributes:
label: Additional context, environment
description: If applicable, add any other context about the problem here. This could also include technical context and environment information such as e.g. OS, Java version, language.
- type: textarea
id: logs
attributes:
label: Logs
description: |
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
render: shell-script
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Discussions
url: https://github.com/thriving-dev/kafka-streams-cassandra-state-store/discussions
about: Use discussions if you have another issue, an idea for improvement or for asking questions.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "🚀 Feature request"
description: Suggest an idea for this project
labels: ["pending triage"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out this feature request!

Please carefully read the contribution docs before suggesting a new feature
👉 https://github.com/thriving-dev/kafka-streams-cassandra-state-store/blob/main/CONTRIBUTING.md
- type: textarea
id: feature-description
attributes:
label: Describe the feature
description: A clear and concise description of what you think would be a helpful addition, including the possible use cases and alternatives you have considered. If you have a working prototype that implements it, please include a link.
placeholder: Feature description
validations:
required: true
- type: checkboxes
id: additional-info
attributes:
label: Additional information
description: Additional information that helps us decide how to proceed.
options:
- label: Would you be willing to help implement this feature?
- type: checkboxes
id: required-info
attributes:
label: Final checks
description: Before submitting, please make sure you do the following
options:
- label: Read the [contribution guide](https://github.com/thriving-dev/kafka-streams-cassandra-state-store/blob/main/CONTRIBUTING.md).
required: true
- label: Check existing [discussions](https://github.com/thriving-dev/kafka-streams-cassandra-state-store/discussions) and [issues](https://github.com/thriving-dev/kafka-streams-cassandra-state-store/issues).
required: true
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- ☝️ PR title should follow conventional commits (https://conventionalcommits.org) -->
<!-- Thanks for taking the time to write this Pull Request! ❤️ -->

### ❓ Type of change

<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->

- [ ] 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

### 📚 Description, Motivation and Context

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For example "Resolves #1337" -->

### 🧪 How Has This Been Tested?

<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, tests ran to see how -->
<!-- your change affects other areas of the code, etc. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/1.pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: "> Main Pipeline"

on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: ['*']
workflow_dispatch:
inputs:
type:
description: 'Release Library'
required: true
default: '...no release'
type: choice
options:
- '...no release'
- major
- minor
- patch

jobs:

build:
name: Build + unit tests
uses: ./.github/workflows/callable.build.yml
if: | # avoid unnecessary pipeline runs during artifact release process ('gradle release plugin')
!contains(github.event.head_commit.message, '[Gradle Release Plugin] - pre tag commit')
|| github.ref_type == 'tag'

code_analysis:
name: Code Analysis (multi)
permissions:
actions: read
contents: read
security-events: write
uses: ./.github/workflows/callable.code-analysis.yml
needs: build
if: |
github.event_name != 'workflow_dispatch'
|| inputs.type == '...no release'

integration_test:
name: Integration tests
uses: ./.github/workflows/callable.integration-test.yml
needs: build

gradle_release:
name: Create release
uses: ./.github/workflows/callable.gradle-release.yml
secrets: inherit
with:
type: ${{ inputs.type }}
needs: integration_test
if: |
github.event_name == 'workflow_dispatch'
&& inputs.type != '...no release'

publish_sonatype:
name: Publish artifact (Maven Central)
uses: ./.github/workflows/callable.publish-sonatype.yml
secrets: inherit
needs: integration_test
if: |
(
github.event_name != 'workflow_dispatch'
|| inputs.type == '...no release'
) && (
github.ref == 'refs/heads/main'
|| github.ref_type == 'tag'
)

publish_javadoc:
name: Publish javadoc (GitHub Pages)
permissions:
contents: write
uses: ./.github/workflows/callable.publish-javadoc.yml
needs: integration_test
if: |
(
github.ref == 'refs/heads/main'
&& ( inputs.type == '' || inputs.type == '...no release' )
) || github.ref_type == 'tag'
15 changes: 15 additions & 0 deletions .github/workflows/2.scheduled.code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ">> Scheduled Code Analysis"

on:
workflow_dispatch:
schedule:
- cron: '23 1 * * 6' # weekly, on Saturday at 01:23 UTC

jobs:
code_analysis:
name: Code Analysis (multi)
permissions:
actions: read
contents: read
security-events: write
uses: ./.github/workflows/callable.code-analysis.yml
43 changes: 0 additions & 43 deletions .github/workflows/build-gradle-project.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/callable.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Gradle Build

on:
workflow_call:

jobs:
build:
name: gradle build test
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4

- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.9.0
with:
cache-write-only: true
- name: Run build (incl. test)
run: ./gradlew build -x intTest --no-daemon

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
56 changes: 56 additions & 0 deletions .github/workflows/callable.code-analysis.codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CodeQL Analysis

on:
workflow_call:

jobs:
analyze:
name: CodeQL Analysis
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
queries: security-extended,security-and-quality

- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.9.0
with:
cache-read-only: true
- name: Run build with Gradle Wrapper
run: |
./gradlew build -x intTest --no-daemon
# ignore ./.gradle folder for analysis
rm -Rf .gradle

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
Loading