Repository navigation
Add GitHub Actions CI/CD workflow (frontend, backend, package, SonarQube) - #34
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/ci.yml, which runs the build, lint and test commands this JHipster app already defines (mirroring theci:*/java:*npm scripts). All commands were run locally on unmodifiedmainfirst and they pass, so no step is markedcontinue-on-error. No application code or build config was changed.Triggers:
pushtomain,pull_request,workflow_dispatch.concurrencycancels superseded runs of the same ref.permissions: contents: read.frontendnpm ci→npm run lint(ESLint) →npm run prettier:check→npx ng test --coverage(Vitest, 401 tests) →npm run webapp:build:prodtarget/test-results/(lcov + sonar vitest XML). Callsng testdirectly becausenpm testhas apretesthook that would run ESLint a second time.backend./mvnw checkstyle:check(nohttp) →./mvnw javadoc:javadoc→./mvnw -Pprod -Dskip.installnodenpm -Dskip.npm verifynpm run ci:backend:test.-Pprodruns unit tests (surefire) and*ITintegration tests (failsafe) against PostgreSQL 18.1 via Testcontainers, which uses the runner's Docker daemon, so no service container is needed. Uploads surefire/failsafe reports and JaCoCo (jacoco,jacoco-it), plustarget/classesfor Sonar.package(CD)./mvnw -Pprod -DskipTests verify→./mvnw -Pprod -DskipTests jib:buildTarnpm run java:jar:prod; the frontend-maven-plugin installs Node and builds the webapp into the jar. Jib writes the image totarget/jib-image.tar(no registry and no push). Uploads the jar and image tarball.sonarqubeSonarSource/sonarqube-scan-action@v8with the existingsonar-project.propertiesfrontend+backendand downloads their coverage/test/class artifacts.SONAR_TOKEN(secret) is exposed throughenv, and each step is gated withif: env.SONAR_TOKEN != '', so without the secret the job only prints a notice and passes.SONAR_HOST_URLcomes from a repo variable, falling back to a secret, and is passed as-Dsonar.host.urlbecause the properties file hard-codeslocalhost:9001.Toolchain: Temurin JDK 21 (
<java.version>21), Node 24.13.0 (<node.version>in pom.xml,enginesin package.json and the devcontainer), and Maven 3.9.12 from./mvnw.MAVEN_ARGS=-ntp --batch-modeis set globally. Caching uses setup-javacache: mavenand setup-nodecache: npm.Actions: pinned to their current major versions:
actions/checkout@v7,setup-java@v6,setup-node@v7,upload-artifact@v7,download-artifact@v8,sonarqube-scan-action@v8. The workflow passesactionlint1.7.12.Not included on purpose:
ci:e2e:*): these need the packaged app running with a PostgreSQL service and Chrome, and upstream JHipster runs them as a separate heavyweight pipeline. They could be added later as their own job.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/726872a9589f4c4f8b73c2daed922b30
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/726872a9589f4c4f8b73c2daed922b30?variant=devin
Requested by: @mbatchelor81