kotlin-files: Minor fixes #146
Workflow file for this run
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
name: java | |
on: [push] | |
jobs: | |
service-tests: | |
needs: java | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: { go-version: '1.18', cache-dependency-path: test-services/tests } | |
- name: Build tests | |
run: | | |
cd test-services/tests | |
go test -c -o service-tests | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: service-tests | |
path: test-services/tests | |
client-test-service: | |
needs: java | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: { go-version: '1.18' } | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/env-common | |
- uses: ./.github/actions/env-build-version | |
- uses: ./.github/actions/install-specgen-golang | |
- uses: ./.github/actions/get-rendr | |
with: { jfrog-pass: "${{ secrets.JFROG_PASS }}", version: "${RENDR_TOOL_VERSION}" } | |
- name: Render project | |
run: ./rendr file:///./templates/service-go --root file:///./test-clients/test-service/template --noinput --set versions.specgen=${SPECGEN_VERSION} --out ./test-service | |
- name: Copy spec.yaml | |
run: cp ./test-clients/spec.yaml ./test-service/spec.yaml | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./test-service | |
yaml-file: .rendr.yaml | |
yaml-path: .build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: client-test-service | |
path: ./test-service | |
java: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/env-build-version | |
- uses: ./.github/actions/build-specgen-plugin | |
with: { plugin-path: codegen/java, specgen-version: "${SPECGEN_VERSION}", artifact-name: specgen-java } | |
java-maven: | |
needs: java | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/env-build-version | |
- uses: actions/setup-java@v3 | |
with: { distribution: 'corretto', java-version: '11' } | |
- uses: actions/download-artifact@v3 | |
with: { name: specgen-java, path: ./plugins/maven-java-specgen/src/main/resources/dist } | |
- uses: ./.github/actions/artifactory-setup-maven | |
with: { jfrog-server-url: specgen.jfrog.io, repo-name: maven, jfrog-user: "${{ secrets.JFROG_USER }}", jfrog-pass: "${{ secrets.JFROG_PASS }}" } | |
- name: Build Maven plugin | |
run: | | |
cd ./plugins/maven-java-specgen | |
sed -i.bak "s/PROJECT_VERSION/${SPECGEN_VERSION}/g" pom.xml | |
mvn clean install --no-transfer-progress | |
- name: Deploy Maven plugin | |
run: | | |
cd ./plugins/maven-java-specgen | |
mvn deploy -Dartifactory=true --no-transfer-progress | |
java-gradle: | |
needs: java | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/env-build-version | |
- uses: actions/setup-java@v3 | |
with: { distribution: 'corretto', java-version: '11' } | |
- uses: actions/download-artifact@v3 | |
with: { name: specgen-java, path: ./plugins/gradle-java-specgen/src/main/resources/dist } | |
- name: Build Gradle plugin | |
run: | | |
cd ./plugins/gradle-java-specgen | |
./gradlew build --build-cache --no-daemon -Pproject.version=${SPECGEN_VERSION} | |
- name: Deploy Gradle plugin | |
run: | | |
cd ./plugins/gradle-java-specgen | |
./gradlew publishAllPublicationsToArtifactoryRepository --build-cache --no-daemon \ | |
-Djfrog.user=${{ secrets.JFROG_USER }} \ | |
-Djfrog.pass=${{ secrets.JFROG_PASS }} \ | |
-Dproject.version=${SPECGEN_VERSION} | |
java-models: | |
needs: java-maven | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
values-file: [jackson, moshi] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: { distribution: 'corretto', java-version: '11' } | |
- uses: ./.github/actions/env-common | |
- uses: ./.github/actions/env-build-version | |
- uses: ./.github/actions/get-rendr | |
with: { jfrog-pass: "${{ secrets.JFROG_PASS }}", version: "${RENDR_TOOL_VERSION}" } | |
- name: Render project | |
run: ./scripts/rendr-test.sh models java ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out | |
- uses: ./.github/actions/artifactory-setup-maven | |
with: { jfrog-server-url: specgen.jfrog.io, repo-name: maven, jfrog-user: "${{ secrets.JFROG_USER }}", jfrog-pass: "${{ secrets.JFROG_PASS }}" } | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./out | |
yaml-file: .rendr.yaml | |
yaml-path: .setup | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./out | |
yaml-file: .rendr.yaml | |
yaml-path: .test | |
java-service: | |
needs: [java-maven, service-tests] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
values-file: [micronaut-jackson, micronaut-moshi, spring-jackson, spring-moshi] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: { distribution: 'corretto', java-version: '11' } | |
- uses: ./.github/actions/env-common | |
- uses: ./.github/actions/env-build-version | |
- uses: ./.github/actions/get-rendr | |
with: { jfrog-pass: "${{ secrets.JFROG_PASS }}", version: "${RENDR_TOOL_VERSION}" } | |
- name: Render project | |
run: ./scripts/rendr-test.sh service java ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out | |
- uses: ./.github/actions/artifactory-setup-maven | |
with: { jfrog-server-url: specgen.jfrog.io, repo-name: maven, jfrog-user: "${{ secrets.JFROG_USER }}", jfrog-pass: "${{ secrets.JFROG_PASS }}" } | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./out | |
yaml-file: .rendr.yaml | |
yaml-path: .build | |
- name: Start service | |
run: | | |
cd ./out | |
$(yq eval .run .rendr.yaml) & | |
- uses: ./.github/actions/wait-url | |
with: | |
url: http://localhost:8081/swagger-ui/ | |
- uses: ./.github/actions/run-service-tests | |
with: { setup-script: ./out/setup-tests.sh } | |
java-client: | |
needs: [java-maven, client-test-service] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
values-file: [micronaut-jackson, micronaut-moshi, okhttp-jackson, okhttp-moshi] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: { distribution: 'corretto', java-version: '11' } | |
- uses: ./.github/actions/env-common | |
- uses: ./.github/actions/env-build-version | |
- uses: ./.github/actions/get-rendr | |
with: { jfrog-pass: "${{ secrets.JFROG_PASS }}", version: "${RENDR_TOOL_VERSION}" } | |
- name: Render project | |
run: ./scripts/rendr-test.sh client java ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out | |
- uses: ./.github/actions/artifactory-setup-maven | |
with: { jfrog-server-url: specgen.jfrog.io, repo-name: maven, jfrog-user: "${{ secrets.JFROG_USER }}", jfrog-pass: "${{ secrets.JFROG_PASS }}" } | |
- uses: ./.github/actions/start-test-service | |
with: { port: "8081" } | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./out | |
yaml-file: .rendr.yaml | |
yaml-path: .setup | |
- uses: ./.github/actions/yaml-execute | |
with: | |
path: ./out | |
yaml-file: .rendr.yaml | |
yaml-path: .test |