Skip to content

Commit

Permalink
fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuehly committed Apr 6, 2024
1 parent e56e0bd commit 9577916
Show file tree
Hide file tree
Showing 21 changed files with 72 additions and 1,914 deletions.
80 changes: 49 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@ on:
branches: [ master ]
jobs:
build:

runs-on: ubuntu-latest
outputs:
cacheKey: ${{ steps.cacheKey.outputs.cacheKey }}
steps:
- run: echo "CACHE_KEY=maven-de-tschuehly-$(date +%s)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
thymeleaf/build.gradle.kts
core/build.gradle.kts
jte/jte/build.gradle.kts
jte/jte-compiler/build.gradle.kts
jte/kte/build.gradle.kts
- name: make gradle executable
run: chmod +x ./gradlew
- name: publishToMavenLocal
run: ./gradlew :core:publishToMavenLocal :thymeleaf:publishToMavenLocal :jte:publishToMavenLocal :jte-compiler:publishToMavenLocal
run: ./gradlew :thymeleaf:publishToMavenLocal :jte-compiler:publishToMavenLocal :jte:publishToMavenLocal :core:publishToMavenLocal :kte:publishToMavenLocal
- name: Cache local Maven repository
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ env.CACHE_KEY }}
Expand All @@ -33,97 +39,109 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/thymeleaf-kotlin-example/build.gradle.kts
- name: run thymeleaf kotlin tests
run: |
cd ./examples/thymeleaf-kotlin-example
cd ./examples
chmod +x ./gradlew
./gradlew test
./gradlew thymeleaf-kotlin-example:test
test-thymeleaf-java:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/thymeleaf-java-example/build.gradle.kts
- name: run thymeleaf java tests
run: |
cd ./examples/thymeleaf-java-example
cd ./examples
chmod +x ./mvnw
./mvnw test
./mvnw -f thymeleaf-java-example test
test-jte:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/jte-example/build.gradle.kts
- name: run jte java tests
run: |
cd ./examples/jte-example
cd ./examples/
chmod +x ./gradlew
./gradlew test
./gradlew jte-example:test
chmod +x ./mvnw
./mvnw test
./mvnw -f jte-example test
test-kte:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/kte-example/build.gradle.kts
- name: run kte kotlin tests
run: |
cd ./examples/kte-example
cd ./examples
chmod +x ./gradlew
./gradlew test
./gradlew kte-example:test
publish:
needs: [test-jte,test-kte, test-thymeleaf-kotlin,test-thymeleaf-java]
needs: [test-jte, test-kte, test-thymeleaf-kotlin,test-thymeleaf-java]
if: github.ref_type == 'tag' || contains(github.ref_name, 'SNAPSHOT')
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions examples/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
Loading

0 comments on commit 9577916

Please sign in to comment.