@@ -18,109 +18,20 @@ jobs:
1818
1919 runs-on : ubuntu-latest
2020
21- steps :
22- - uses : actions/checkout@v2
23-
24- - name : Set up JDK 11
25- uses : actions/setup-java@v2
26- with :
27- java-version : ' 11'
28- distribution : ' microsoft'
29-
30- - name : set JDK_11 environment variable test compiling and running
31- env :
32- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
33- run : echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34-
35- - name : Set up JDK 8
36- uses : actions/setup-java@v2
37- with :
38- java-version : ' 8'
39- distribution : ' temurin'
40-
41- - name : Setup Gradle
42- uses : gradle/gradle-build-action@v2
43-
44- - name : Build with Gradle
45- run : ./gradlew build -x test
46-
47- - name : Run SpotBugs
48- run : ./gradlew spotbugsMain spotbugsTest
49- continue-on-error : false
50-
51- - name : Upload SpotBugs reports
52- uses : actions/upload-artifact@v4
53- with :
54- name : SpotBugs Reports
55- path : ' **/build/reports/spotbugs'
56- if-no-files-found : ignore
57-
58- - name : Run Unit Tests with Gradle
59- run : |
60- export JAVA_HOME=$JDK_11
61- ./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
62- continue-on-error : true
63-
64- - name : Upload test reports if tests failed
65- if : env.UNIT_TEST_FAILED == 'true'
66- uses : actions/upload-artifact@v4
67- with :
68- name : Unit Test Reports
69- path : ' **/build/reports/tests/test'
70- if-no-files-found : ignore # Prevents errors if no reports exist
71-
72- - name : Fail the job if unit tests failed
73- if : env.UNIT_TEST_FAILED == 'true'
74- run : exit 1
75-
76- # TODO: Move the sidecar into a central image repository
77- - name : Initialize Durable Task Sidecar
78- run : docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator
79-
80- - name : Display Durable Task Sidecar Logs
81- run : nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &
82-
83- # wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
84- - name : Wait for 10 seconds
85- run : sleep 10
86-
87- - name : Integration Tests with Gradle
88- run : ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
89- continue-on-error : true
90-
91- - name : Kill Durable Task Sidecar
92- run : docker kill durabletask-sidecar
93-
94- - name : Upload Durable Task Sidecar Logs
95- uses : actions/upload-artifact@v4
96- with :
97- name : Durable Task Sidecar Logs
98- path : durabletask-sidecar.log
99-
100- - name : Archive test report
101- uses : actions/upload-artifact@v4
102- with :
103- name : Integration test report
104- path : client/build/reports/tests/integrationTest
105-
106- - name : Upload JAR output
107- uses : actions/upload-artifact@v4
108- with :
109- name : Package
110- path : client/build/libs
111-
112- - name : Fail the job if tests failed
113- if : env.TEST_FAILED == 'true'
114- run : exit 1
115-
116- functions-e2e-tests :
117-
118- needs : build
119- runs-on : ubuntu-latest
120-
12121 steps :
12222 - uses : actions/checkout@v2
12323
24+ - name : Set up JDK 11
25+ uses : actions/setup-java@v2
26+ with :
27+ java-version : ' 11'
28+ distribution : ' microsoft'
29+
30+ - name : set JDK_11 environment variable test compiling and running
31+ env :
32+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
33+ run : echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34+
12435 - name : Set up JDK 8
12536 uses : actions/setup-java@v2
12637 with :
@@ -130,63 +41,74 @@ jobs:
13041 - name : Setup Gradle
13142 uses : gradle/gradle-build-action@v2
13243
133- - name : Publish to local
134- run : ./gradlew publishToMavenLocal -PskipSigning
135-
136- - name : Build azure functions sample
137- run : ./gradlew azureFunctionsPackage
138- continue-on-error : true
44+ - name : Build with Gradle
45+ run : ./gradlew build -x test
13946
140- - name : Setup azure functions runtime
141- run : endtoendtests/e2e-test-setup.ps1 -DockerfilePath endtoendtests/Dockerfile
142- shell : pwsh
47+ - name : Run SpotBugs
48+ run : ./gradlew spotbugsMain spotbugsTest
49+ continue-on-error : false
14350
144- - name : End to End Tests with Gradle
145- uses : gradle/gradle-build-action@v2
51+ - name : Upload SpotBugs reports
52+ uses : actions/upload-artifact@v4
14653 with :
147- arguments : endToEndTest
54+ name : SpotBugs Reports
55+ path : ' **/build/reports/spotbugs'
56+ if-no-files-found : ignore
57+
58+ - name : Run Unit Tests with Gradle
59+ run : |
60+ export JAVA_HOME=$JDK_11
61+ ./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
62+ continue-on-error : true
14863
149- - name : Archive test report
64+ - name : Upload test reports if tests failed
65+ if : env.UNIT_TEST_FAILED == 'true'
15066 uses : actions/upload-artifact@v4
15167 with :
152- name : Integration test report
153- path : client/build/reports/tests/endToEndTest
154-
155- functions-sample-tests :
156-
157- needs : build
158- runs-on : ubuntu-latest
68+ name : Unit Test Reports
69+ path : ' **/build/reports/tests/test'
70+ if-no-files-found : ignore # Prevents errors if no reports exist
15971
160- steps :
161- - uses : actions/checkout@v2
72+ - name : Fail the job if unit tests failed
73+ if : env.UNIT_TEST_FAILED == 'true'
74+ run : exit 1
16275
163- - name : Set up JDK 8
164- uses : actions/setup-java@v2
165- with :
166- java-version : ' 8'
167- distribution : ' temurin'
76+ # TODO: Move the sidecar into a central image repository
77+ - name : Initialize Durable Task Sidecar
78+ run : docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator
16879
169- - name : Setup Gradle
170- uses : gradle/gradle-build-action@v2
80+ - name : Display Durable Task Sidecar Logs
81+ run : nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &
17182
172- - name : Publish to local
173- run : ./gradlew publishToMavenLocal -PskipSigning
83+ # wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
84+ - name : Wait for 10 seconds
85+ run : sleep 10
17486
175- - name : Build azure functions sample
176- run : ./gradlew azureFunctionsPackage
87+ - name : Integration Tests with Gradle
88+ run : ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
17789 continue-on-error : true
17890
179- - name : Setup azure functions runtime
180- run : samples-azure-functions/e2e-test-setup.ps1 -DockerfilePath samples-azure-functions/Dockerfile
181- shell : pwsh
91+ - name : Kill Durable Task Sidecar
92+ run : docker kill durabletask-sidecar
18293
183- - name : Sample Tests with Gradle
184- uses : gradle/gradle-build-action@v2
94+ - name : Upload Durable Task Sidecar Logs
95+ uses : actions/upload-artifact@v4
18596 with :
186- arguments : sampleTest
97+ name : Durable Task Sidecar Logs
98+ path : durabletask-sidecar.log
18799
188100 - name : Archive test report
189101 uses : actions/upload-artifact@v4
190102 with :
191103 name : Integration test report
192- path : client/build/reports/tests/endToEndTest
104+ path : client/build/reports/tests/integrationTest
105+
106+ - name : Upload JAR output
107+ uses : actions/upload-artifact@v4
108+ with :
109+ name : Package
110+ path : client/build/libs
111+
112+ - name : Fail the job if tests failed
113+ if : env.TEST_FAILED == 'true'
114+ run : exit 1
0 commit comments