77
88jobs :
99 generate :
10+ strategy :
11+ fail-fast : false
12+ matrix :
13+ include :
14+ - language : ts
15+ copy : " /bin/cp -rf ./clients/ts/. h1-client-ts"
16+ directory : " h1-client-ts"
17+ repository : " hyperonecom/h1-client-js"
18+ build : " yarn"
19+ - language : go
20+ copy : " /bin/cp -rf ./clients/go/. h1-client-go"
21+ directory : " h1-client-go"
22+ repository : " hyperonecom/h1-client-go"
23+ build : " go build -o temporary_build && rm temporary_build"
24+ - language : python
25+ copy : " /bin/cp -rf ./clients/python/. h1-client-python"
26+ directory : " h1-client-python"
27+ repository : " hyperonecom/h1-client-python"
28+ build : " pip install -e ."
1029 runs-on : ubuntu-latest
30+ env :
31+ GO_POST_PROCESS_FILE : " /usr/local/bin/gofmt -w"
32+ LANGUAGE : " ${{ matrix.language }}"
1133 steps :
1234 - name : Checkout generator repository
1335 uses : actions/checkout@v1
2345 uses : actions/setup-go@v2
2446 with :
2547 go-version : 1.14.x
48+ - name : Set up Python 3.6
49+ uses : actions/setup-python@v2
50+ with :
51+ python-version : 3.6
2652 - name : Configure github credentials
2753 run : |
2854 git config --global user.email "action@github.com"
@@ -35,76 +61,29 @@ jobs:
3561 PASSPORT_FILE : ${{ secrets.PASSPORT_FILE }}
3662 - name : Install dependencies
3763 run : yarn
38- - name : Generate and test TS client
39- run : yarn start ts
40- - name : Checkout TS Client repo
41- uses : actions/checkout@v2
42- with :
43- persist-credentials : false
44- fetch-depth : 0
45- repository : hyperonecom/h1-client-js
46- path : h1-client-ts
47- - name : Copy TS client
48- run : /bin/cp -rf ./clients/ts/. h1-client-ts
49- - name : Commit TS client
50- run : |
51- git add .
52- git diff-index --quiet HEAD || git commit -m "Update $(date)"
53- working-directory : h1-client-ts
54- - name : Push TS client
55- uses : ad-m/github-push-action@master
56- with :
57- github_token : ${{ secrets.PUSH_TOKEN }}
58- directory : h1-client-ts
59- repository : hyperonecom/h1-client-js
60- - name : Generate and test Go client
61- run : yarn start go
62- - name : Test building Go client
63- run : go build -o temporary_build && rm temporary_build
64- working-directory : ./clients/go/
65- - name : Checkout Go Client repo
66- uses : actions/checkout@v2
67- with :
68- persist-credentials : false
69- fetch-depth : 0
70- repository : hyperonecom/h1-client-go
71- path : h1-client-go
72- - name : Copy Go client
73- run : /bin/cp -rf ./clients/go/. h1-client-go
74- - name : Commit Go client
75- run : |
76- git add .
77- git diff-index --quiet HEAD || git commit -m "Update $(date)"
78- working-directory : h1-client-go
79- - name : Push Go client
80- uses : ad-m/github-push-action@master
81- with :
82- github_token : ${{ secrets.PUSH_TOKEN }}
83- directory : h1-client-go
84- repository : hyperonecom/h1-client-go
85- - name : Set up Python 3.6
86- uses : actions/setup-python@v2
87- with :
88- python-version : 3.6
89- - name : Generate and test Python client
90- run : yarn start python
91- - name : Checkout Python Client repo
64+ - name : Generate and test client
65+ run : yarn start "$LANGUAGE"
66+ - name : Test building client
67+ run : " ${{ matrix.build }}"
68+ working-directory : " ./clients/${{ matrix.language }}"
69+ - name : Checkout Client repo
9270 uses : actions/checkout@v2
9371 with :
9472 persist-credentials : false
9573 fetch-depth : 0
96- repository : hyperonecom/h1-client-python
97- path : h1-client-python
98- - name : Copy Python client
99- run : /bin/cp -rf ./clients/python/. h1-client-python
100- - name : Commit Python client
74+ repository : " ${{ matrix.repository }} "
75+ path : " ${{ matrix.directory }} "
76+ - name : Copy client
77+ run : " ${{ matrix.copy }} "
78+ - name : Commit client
10179 run : |
10280 git add .
10381 git diff-index --quiet HEAD || git commit -m "Update $(date)"
104- working-directory : h1-client-python
105- - name : Push Python client
82+ working-directory : " ${{ matrix.directory }} "
83+ - name : Push client
10684 uses : ad-m/github-push-action@master
85+ if : " ${{ success() && github.ref == 'refs/heads/master' }}"
10786 with :
10887 github_token : ${{ secrets.PUSH_TOKEN }}
109- directory : h1-client-python
110- repository : hyperonecom/h1-client-python
88+ directory : " ${{ matrix.directory }} "
89+ repository : " ${{ matrix.repository }} "
0 commit comments