Skip to content

Added files support for Spring and Micronaut services and OkHttp clie… #147

Added files support for Spring and Micronaut services and OkHttp clie…

Added files support for Spring and Micronaut services and OkHttp clie… #147

Workflow file for this run

name: golang
on: [push]
jobs:
service-tests:
needs: golang
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: golang
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
golang:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with: { go-version: '1.18' }
- uses: actions/checkout@v3
- name: Build golang codegen
run: |
cd codegen/golang
go build
golang-models:
needs: golang
runs-on: ubuntu-latest
strategy:
matrix:
values-file: [strict, nonstrict]
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: ./scripts/rendr-test.sh models go ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out
- uses: ./.github/actions/yaml-execute
with:
path: ./out
yaml-file: .rendr.yaml
yaml-path: .build
- uses: ./.github/actions/yaml-execute
with:
path: ./out
yaml-file: .rendr.yaml
yaml-path: .test
golang-service:
needs: [golang, service-tests]
strategy:
matrix:
values-file: [vestigo-strict, chi-strict, httprouter-strict]
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: ./scripts/rendr-test.sh service go ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out
- 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/docs/
- uses: ./.github/actions/run-service-tests
with: { setup-script: ./out/setup-tests.sh }
golang-client:
needs: [golang, client-test-service]
strategy:
matrix:
values-file: [strict, nonstrict]
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: ./scripts/rendr-test.sh client go ${{ matrix.values-file }} ${SPECGEN_VERSION} ./out
- 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: .build
- uses: ./.github/actions/yaml-execute
with:
path: ./out
yaml-file: .rendr.yaml
yaml-path: .test