Skip to content
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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: 2
updates:
- package-ecosystem: maven
directories:
- "/{{cookiecutter.app_name}}/"
- "/examples/"
schedule:
interval: daily
time: "23:30"
# open-pull-requests-limit: 10
open-pull-requests-limit: 10
reviewers:
- paul58914080
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Continuous Integration
on:
pull_request:
branches:
- main
paths:
- 'example/**'
- '.github/workflows/ci.yaml'
workflow_dispatch:
jobs:
example-ci:
defaults:
run:
working-directory: ./example
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean install -ntp
generate-template:
needs: example-ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make script executable
run: chmod +x ./generate-cookiecutter-template-from-example-project.sh
- name: Generate cookiecutter template
run: ./generate-cookiecutter-template-from-example-project.sh
- name: Copy generated template to {{cookiecutter.app_name}}
run: |
rsync -a --delete --exclude='.git' ./example-tryout/ ./{{cookiecutter.app_name}}/
- name: Commit & push generated changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull --rebase origin ${{ github.head_ref }}
git add .
git diff --cached --quiet || git commit -m "ci: update generated cookiecutter template from example"
git push origin HEAD:${{ github.head_ref }}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Generate cookiecutter template from example project
on:
pull_request:
branches:
- main
paths:
- 'example/**'
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make script executable
run: chmod +x ./generate-cookiecutter-template-from-example-project.sh
- name: Generate cookiecutter template
run: ./generate-cookiecutter-template-from-example-project.sh
- name: Is there is difference in the generated template?
run: |
set -e
DIFF_OUTPUT=$(diff -qr example-tryout {{cookiecutter.app_name}} --exclude='.DS_Store' || true)
if [ -n "$DIFF_OUTPUT" ]; then
echo "$DIFF_OUTPUT"
echo "$DIFF_OUTPUT" > diff-output.txt
exit 1
fi
#name: Generate cookiecutter template from example project
#on:
# pull_request:
# branches:
# - main
# paths:
# - 'example/**'
# workflow_dispatch:
#jobs:
# generate:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Make script executable
# run: chmod +x ./generate-cookiecutter-template-from-example-project.sh
# - name: Generate cookiecutter template
# run: ./generate-cookiecutter-template-from-example-project.sh
# - name: Is there is difference in the generated template?
# run: |
# set -e
# DIFF_OUTPUT=$(diff -qr example-tryout {{cookiecutter.app_name}} --exclude='.DS_Store' || true)
# if [ -n "$DIFF_OUTPUT" ]; then
# echo "$DIFF_OUTPUT"
# echo "$DIFF_OUTPUT" > diff-output.txt
# exit 1
# fi
82 changes: 41 additions & 41 deletions .github/workflows/scaffold-from-template-target-project.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
name: Scaffold code from template
on:
pull_request:
branches:
- main
paths:
- '{{cookiecutter.app_name}}/**'
workflow_dispatch:
jobs:
scaffold:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Install cookiecutter
run: pip install cookiecutter
- name: Test cookiecutter
run: cookiecutter --config-file=test-config.yml --no-input .
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- name: Build with Maven
run: |
cd cart-service
mvn git-code-format:format-code
mvn clean install -ntp
#name: Scaffold code from template
#on:
# pull_request:
# branches:
# - main
# paths:
# - '{{cookiecutter.app_name}}/**'
# workflow_dispatch:
#jobs:
# scaffold:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.9'
# - name: Cache pip
# uses: actions/cache@v4
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# - name: Install cookiecutter
# run: pip install cookiecutter
# - name: Test cookiecutter
# run: cookiecutter --config-file=test-config.yml --no-input .
# - name: Set up JDK 21
# uses: actions/setup-java@v4
# with:
# distribution: 'temurin'
# java-version: '21'
# - name: Cache Maven packages
# uses: actions/cache@v4
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# - name: Build with Maven
# run: |
# cd cart-service
# mvn git-code-format:format-code
# mvn clean install -ntp
Empty file modified generate-cookiecutter-template-from-example-project.sh
100644 → 100755
Empty file.