Skip to content

update checkout and fix docker compose #64

update checkout and fix docker compose

update checkout and fix docker compose #64

Workflow file for this run

name: Integration
on:
- pull_request
- push
jobs:
csharp:
name: CSharp
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/csharp
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.cs ./integration/csharp/
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Run
run: bin/Release/net6.0/generator
go:
name: Go
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/go
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.go ./integration/go/
- name: Build
run: go build -v
- name: Run
run: ./main
java:
name: Java
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/java
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.java ./integration/java/
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
- name: Run
run: java -jar target/generator-0.1.0-jar-with-dependencies.jar
php:
name: PHP
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/php
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Move
working-directory: .
run: cp ./output/*.php ./integration/php/
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run
run: php main.php
python:
name: Python
runs-on: ubuntu-latest
services:
mock:
image: mockserver/mockserver
ports:
- 1080:1080
defaults:
run:
working-directory: integration/python
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Init mockserver
run: "curl -X PUT http://127.0.0.1:1080/mockserver/expectation -H 'Content-Type: application/json' -d @./../../mockserver/initializerJson.json"
- name: Move sdkgen.json file
run: mv ./sdkgen.json ../../input/
- name: Generate
working-directory: .
env:
SDKGEN_CLIENT_ID: ${{ secrets.SDKGEN_CLIENT_ID }}
SDKGEN_CLIENT_SECRET: ${{ secrets.SDKGEN_CLIENT_SECRET }}
run: docker compose up
- name: Create sdk dir
run: mkdir sdk
- name: Move
working-directory: .
run: cp ./output/*.py ./integration/python/sdk
- name: PIP install
run: pip install -r requirements.txt
- name: Run
run: python main.py