-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* spring forge initial commit * add pcalouche github registry * another permission change * more repository config * misc polish
- Loading branch information
Showing
22 changed files
with
320 additions
and
686 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# update git's index (bc they get messy with the pre-commit hook) according to | ||
# https://prettier.io/docs/en/precommit.html | ||
# see also https://github.com/prettier/prettier/issues/2978 | ||
git update-index -g |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
echo "Running pre-commit hook: formatting files" | ||
|
||
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') | ||
[ -z "$FILES" ] && exit 0 | ||
|
||
# Apply formatting to all files | ||
make format | ||
|
||
# Add back the formatted files to staging | ||
echo "$FILES" | xargs git add | ||
|
||
exit 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: 2 | ||
registries: | ||
github: | ||
type: "maven-repository" | ||
url: "https://maven.pkg.github.com/pcalouche/*" | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
updates: | ||
- package-ecosystem: "maven" | ||
directory: "/" | ||
registries: "*" | ||
schedule: | ||
interval: "daily" | ||
target-branch: "main" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
target-branch: "main" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-run-tests: | ||
name: Build and Run Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
show-progress: false | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Run Maven | ||
run: mvn -B clean verify | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,45 @@ | ||
HELP.md | ||
/target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
# Heavily influenced by https://www.toptal.com/developers/gitignore?templates=java,jetbrains,macos | ||
|
||
### Additional inclusions and exclusions specific to this project ### | ||
|
||
### Java ### | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* | ||
|
||
### Maven ### | ||
target/ | ||
# flatten-maven-plugin | ||
.flattened-pom.xml | ||
|
||
### JetBrains ### | ||
.idea/* | ||
!.idea/codeStyles | ||
!.idea/runConfigurations | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
/build/ | ||
### macOS ### | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<servers> | ||
<server> | ||
<id>github</id> | ||
<username>${env.GITHUB_ACTOR}</username> | ||
<password>${env.GITHUB_TOKEN}</password> | ||
</server> | ||
</servers> | ||
</settings> |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Format the code | ||
.PHONY: format | ||
format: | ||
mvn spotless:apply spring-javaformat:apply | ||
|
||
# Run tests and verify | ||
.PHONY: mvn-verify | ||
mvn-verify: format | ||
mvn clean verify | ||
|
||
# Skip tests and verify | ||
.PHONY: mvn-verify-skip-tests | ||
mvn-verify-skip-tests: format | ||
mvn clean verify -DskipTests | ||
|
||
# Run tests and install locally | ||
.PHONY: mvn-install | ||
mvn-install: format | ||
mvn clean install | ||
|
||
# Skip tests and install locally | ||
.PHONY: mvn-install-skip-tests | ||
mvn-install-skip-tests: format | ||
mvn clean install -DskipTests | ||
|
||
# Check if version is a SNAPSHOT | ||
.PHONY: check-if-snapshot-version | ||
check-if-snapshot-version: | ||
version="$(shell mvn help:evaluate -Dexpression=spring-enzymes.version -q -DforceStdout)" ; \ | ||
echo "version is $$version" ; \ | ||
if [[ $$version == *-SNAPSHOT ]]; then \ | ||
echo "Release version is a SNAPSHOT, so manual deploy can proceed." ; \ | ||
else \ | ||
echo "Release version is NOT a SNAPSHOT. Use a SNAPSHOT version to deploy or deploy with GitHub Actions CD." ; \ | ||
exit 1 ; \ | ||
fi | ||
|
||
# Run tests and deploy SNAPSHOT version | ||
.PHONY: mvn-deploy-snapshot | ||
mvn-deploy-snapshot: check-if-snapshot-version format | ||
mvn clean deploy | ||
|
||
# Skip tests and deploy SNAPSHOT version | ||
.PHONY: mvn-deploy-snapshot-skip-tests | ||
mvn-deploy-snapshot-skip-tests: check-if-snapshot-version format | ||
mvn clean deploy -DskipTests | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
## Spring Skeleton | ||
|
||
Spring Skeleton is a sample project to showcase the [Spring Elixir Library](https://github.com/pcalouche/springelixir) that uses Spring | ||
Spring Skeleton is a sample project to showcase the [Spring Forge Library](https://github.com/pcalouche/spring-forge) that uses Spring | ||
Auto-configuration to help with the configuration of some things. | ||
|
||
Spring Elixir provides a status endpoint, standard controller advice exception handling, and Open Api documentation configured. Running this application and | ||
Spring Forge provides a status endpoint, standard controller advice exception handling, and Open Api documentation configured. Running this application and | ||
going to [localhost:8080/swagger-ui.html](localhost:8080/swagger-ui.html) will display the Open Api documentation. From there you'll see two endpoints: | ||
|
||
1. /status - Demonstrates the status endpoint that is auto-configured by Spring Elixir. | ||
1. /exception-test - Demonstrates and endpoint that will throw and exception. The JSON response returned is derived from the code in Spring Elixir. | ||
1. /status - Demonstrates the status endpoint that is auto-configured by Spring Forge. | ||
2. /exception-test - Demonstrates and endpoint that will throw and exception. The JSON response returned is derived from the code in Spring Forge. | ||
|
Oops, something went wrong.