-
Notifications
You must be signed in to change notification settings - Fork 3
174 lines (147 loc) · 5.56 KB
/
pull-tests.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Test on pull request
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
permissions:
checks: write
jobs:
python-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
timeout-minutes: 35
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox tox-gh-actions
- name: Build protobuf
run: cd pylzy && ./scripts/gen_proto.sh && cd ..
- name: Test
run: cd pylzy && tox -- -vv && cd ..
- name: 'upload coverage badge'
uses: exuanbo/actions-deploy-gist@v1
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.9'
with:
token: ${{ secrets.GIST_SECRET }}
gist_id: 0095e900fb0fcbe5575ddc3c717fb65b
file_path: pylzy/coverage.svg
file_type: binary
gist_file_name: ${{ (github.head_ref || github.ref_name) }}-coverage.svg
java-unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 35
defaults:
run:
shell: bash -l {0}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup JDK 17'
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Tests
run: mvn install
- name: 'generate java coverage badge'
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: coverage/target/site/jacoco-aggregate/jacoco.csv
badges-directory: coverage/target/site/jacoco-aggregate
generate-coverage-badge: true
coverage-badge-filename: jacoco.svg
coverage-label: java-coverage
- name: 'upload java coverage badge'
uses: exuanbo/actions-deploy-gist@v1
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GIST_SECRET }}
gist_id: be651155cb12a8006cecdee948ce1a0a
file_path: coverage/target/site/jacoco-aggregate/jacoco.svg
file_type: binary
gist_file_name: ${{ (github.head_ref || github.ref_name) }}-java-coverage.svg
- name: 'Clear after tests'
if: always()
run: |
SHA=${{ github.sha }}
sudo mkdir -p /tmp/old-lzy-logs/$SHA
sudo tar -czvf /tmp/old-lzy-logs/$SHA/logs.tar.gz /tmp/lzy-log
sudo rm -rf /tmp/lzy* /tmp/h2* /tmp/local_modules* /tmp/resources* /tmp/term* /tmp/worker* /tmp/tmp*
sudo rm -rf /tmp/temp* /tmp/test* /tmp/*json /tmp/*txt /tmp/*so /tmp/*lck /tmp/*sh /tmp/gen-rsa-keys*
sudo rm -rf /tmp/kafka-logs* /tmp/zookeeper-logs* /tmp/s3mockFileStore* /tmp/Log4j2Plugins*
- name: 'Publish Test Report'
uses: EnricoMi/publish-unit-test-result-action@v1
if: github.ref == 'refs/heads/master'
with:
files: "**/surefire-reports/TEST-*.xml"
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup conda"
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: py39
python-version: 3.9.7
- name: 'Setup JDK 17'
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: 'install pylzy'
run: |
cd pylzy/
conda activate py39
pip install -r proto_requirements.txt --no-cache && ./scripts/build.sh
pip install -r test_requirements.txt --no-cache
pip install . --force-reinstall --upgrade --no-cache
conda env list --json | jq '.envs|.[]' | xargs -I'@' bash -c 'eval "$(conda shell.bash hook)" && conda activate @ && conda env export > @/conda-desc.yaml && conda env export'
cd ..
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: 'java compile'
timeout-minutes: 10
run: mvn -T 8 install -DskipTests -Dmaven.test.skip -Dmaven.javadoc.skip=true
- name: 'SchedulerTest'
timeout-minutes: 5
run: |
cd test && mvn test -Dtest=SchedulerTest -DargLine="-Djava.util.concurrent.ForkJoinPool.common.parallelism=64" && cd ..
- name: 'StorageClientTest'
timeout-minutes: 5
run: |
cd test && mvn test -Dtest=StorageClientTest -DargLine="-Djava.util.concurrent.ForkJoinPool.common.parallelism=64" && cd ..
- name: 'WorkflowTest'
timeout-minutes: 5
run: |
cd test && mvn test -Dtest=WorkflowTest -DargLine="-Djava.util.concurrent.ForkJoinPool.common.parallelism=64" && cd ..
- name: 'PyApiTest'
timeout-minutes: 35
run: |
cd test && mvn test -Dtest=PyApiTest -DargLine="-Djava.util.concurrent.ForkJoinPool.common.parallelism=64" && cd ..
- name: 'Publish Test Report'
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: "**/surefire-reports/TEST-*.xml"