-
Notifications
You must be signed in to change notification settings - Fork 82
81 lines (71 loc) · 1.95 KB
/
generate-test-code.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Generate test code
on:
workflow_dispatch:
inputs:
scope:
type: choice
description: scope of the test code to generate
required: true
default: autorest
options:
- all
- autorest
- typespec
jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
deployments: none
packages: none
pull-requests: none
security-events: none
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install autorest
run: |
npm install -g autorest
npm ci --no-bin-links
- name: Setup jdk 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Patch core
run: |
cd core
git checkout .
git apply ../core.diff --ignore-whitespace
cd ..
- name: Build autorest-java, install modules
run: |
mvn install -f pom.xml -P local,tsp --no-transfer-progress
- name: Generate test code for autorest-java
if: ${{ inputs.scope == 'all' || inputs.scope == 'autorest' }}
shell: pwsh
run: |
./Generate.ps1 -Parallelization 1
- name: Generate test code for typespec-java
if: ${{ inputs.scope == 'all' || inputs.scope == 'typespec' }}
shell: pwsh
run: |
cd typespec-tests
./Generate.ps1 -Parallelization 1
cd ..
- name: Commit generated code
run: |
git config --global user.name 'actions-user'
git config --global user.email '[email protected]'
git add .
git commit -m "re-generate test code"
git push