@@ -10,52 +10,18 @@ name: test
10
10
11
11
on :
12
12
push :
13
- workflow_call :
14
- outputs :
15
- should_run_core_integration_tests :
16
- description : ' Whether core integration tests should run'
17
- value : ${{ jobs.check_paths.outputs.should_run_query_tests }}
18
-
19
- env :
20
- QUERY_SERVICE_PATHS : ' weave-js/ weave_query/'
21
13
22
14
jobs :
23
- check_paths :
24
- runs-on : ubuntu-latest
25
- outputs :
26
- should_run_query_tests : ${{ steps.query_service.outputs.should_run_query_tests }}
27
- steps :
28
- - uses : actions/checkout@v3
29
- with :
30
- fetch-depth : 0
31
- fetch-tags : true
32
- ref : ${{ github.head_ref }}
33
- - run : git fetch origin ${{ github.base_ref }}
34
- - id : query_service
35
- run : |
36
- if [ "${{ github.event_name }}" = "pull_request" ]; then
37
- base_sha=$(git rev-parse origin/${{ github.base_ref }})
38
- head_sha=$(git rev-parse HEAD)
39
- changed_files=$(git diff --name-only $base_sha $head_sha)
40
- else
41
- changed_files=$(git diff --name-only HEAD^)
42
- fi
43
-
44
- for path in ${{ env.WATCHED_PATHS }}; do
45
- if echo "$changed_files" | grep -q "$path"; then
46
- echo "should_run_query_tests=true" >> $GITHUB_OUTPUT
47
- exit 0
48
- fi
49
- done
50
- echo "should_run_query_tests=false" >> $GITHUB_OUTPUT
15
+ determine_tests :
16
+ uses : ./github/workflows/which-tests-to-run.yaml
51
17
52
18
# ==== Query Service Jobs ====
53
19
build-container-query-service :
54
20
name : Build Legacy (Query Service) test container
55
21
timeout-minutes : 30
56
22
runs-on : [self-hosted, builder]
57
23
needs : check_paths
58
- if : ${{ needs.check_paths .outputs.should_run_query_tests == 'true' }}
24
+ if : ${{ needs.determine_tests .outputs.should_run_query_tests == 'true' }}
59
25
60
26
# runs-on: ubuntu-latest
61
27
env :
@@ -134,7 +100,7 @@ jobs:
134
100
needs :
135
101
- test-query-service
136
102
- check_paths
137
- if : ${{ needs.check_paths .outputs.should_run_query_tests == 'true' }}
103
+ if : ${{ needs.determine_tests .outputs.should_run_query_tests == 'true' }}
138
104
139
105
runs-on : ubuntu-latest
140
106
@@ -149,7 +115,7 @@ jobs:
149
115
name : WeaveJS Lint and Compile
150
116
runs-on : ubuntu-latest
151
117
needs : check_paths
152
- if : ${{ needs.check_paths .outputs.should_run_query_tests == 'true' }}
118
+ if : ${{ needs.determine_tests .outputs.should_run_query_tests == 'true' }}
153
119
# runs-on: [self-hosted, gke-runner]
154
120
steps :
155
121
- uses : actions/checkout@v2
0 commit comments