Skip to content

Commit f06ab12

Browse files
committed
update action
Signed-off-by: salaboy <[email protected]>
1 parent 02aec51 commit f06ab12

File tree

1 file changed

+93
-93
lines changed

1 file changed

+93
-93
lines changed

.github/workflows/build-validation.yml

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -19,99 +19,99 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
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
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
115115

116116
functions-e2e-tests:
117117

0 commit comments

Comments
 (0)