-
Notifications
You must be signed in to change notification settings - Fork 192
134 lines (112 loc) · 4.34 KB
/
run_all_tests.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
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
# Runs all Marqo tests.
# - The goal is a single workflow that, if all jobs pass, is sufficient to
# merge.
# - This can be run manually. It is automatically triggered if a PR is
# approved.
# - The automatic trigger on PR approvals is skipped if only markdown files
# have changed.
name: Run all Marqo tests
on:
pull_request_review:
types: [submitted]
branches:
- mainline
workflow_dispatch:
permissions:
contents: read
jobs:
should-tests-run:
name: Determine whether tests should run
runs-on: ubuntu-latest
outputs:
decision: ${{ steps.decision.outputs.result }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check if only markdown files have changed
id: filter
uses: dorny/paths-filter@v2
with:
filters: |
proceed:
- '**'
- '!*.md'
- name: Decide whether to run tests
id: decision
run: |
if [[ "${{ github.event_name }}" == "pull_request_review" && \
"${{ github.event.review.state }}" == "approved" && \
"${{ steps.filter.outputs.proceed }}" == "true" ]] \
|| [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "::set-output name=result::true"
else
echo "::set-output name=result::false"
fi
run-arm64-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/arm64_docker_marqo.yml
secrets: inherit
run-cuda-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/cuda_docker_marqo.yml
secrets: inherit
run-cpu-docker-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/cpu_docker_marqo.yml
secrets: inherit
run-largemodel-unit-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/largemodel_unit_test_CI.yml
secrets: inherit
run-cpu-local-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/cpu_local_marqo.yml
secrets: inherit
run-unit-tests:
needs: should-tests-run
if: needs.should-tests-run.outputs.decision == 'true'
uses: ./.github/workflows/unit_test_200gb_CI.yml
secrets: inherit
summary:
if: ${{ always() }}
name: Test Summary
needs: [should-tests-run, run-arm64-tests, run-cuda-tests, run-cpu-docker-tests, run-largemodel-unit-tests, run-cpu-local-tests, run-unit-tests]
runs-on: ubuntu-latest
steps:
- name: Check test results
run: |
# If tests weren't intended to run, consider this a success
if [[ "${{ needs.should-tests-run.outputs.decision }}" != "true" ]]; then
echo "Tests were skipped. No further checks required."
exit 0
fi
if [[ "${{ needs.run-arm64-tests.result }}" != "success" && "${{ needs.run-arm64-tests.result }}" != "skipped" ]]; then
echo "Job run-arm64-tests did not succeed."
exit 1
fi
if [[ "${{ needs.run-cuda-tests.result }}" != "success" && "${{ needs.run-cuda-tests.result }}" != "skipped" ]]; then
echo "Job run-cuda-tests did not succeed."
exit 1
fi
if [[ "${{ needs.run-cpu-docker-tests.result }}" != "success" && "${{ needs.run-cpu-docker-tests.result }}" != "skipped" ]]; then
echo "Job run-cpu-docker-tests did not succeed."
exit 1
fi
if [[ "${{ needs.run-largemodel-unit-tests.result }}" != "success" && "${{ needs.run-largemodel-unit-tests.result }}" != "skipped" ]]; then
echo "Job run-largemodel-unit-tests did not succeed."
exit 1
fi
if [[ "${{ needs.run-cpu-local-tests.result }}" != "success" && "${{ needs.run-cpu-local-tests.result }}" != "skipped" ]]; then
echo "Job run-cpu-local-tests did not succeed."
exit 1
fi
if [[ "${{ needs.run-unit-tests.result }}" != "success" && "${{ needs.run-unit-tests.result }}" != "skipped" ]]; then
echo "Job run-unit-tests did not succeed."
exit 1
fi
echo "All tests either passed or were skipped."