1
+ #
2
+ # Licensed to the Apache Software Foundation (ASF) under one or more
3
+ # contributor license agreements. See the NOTICE file distributed with
4
+ # this work for additional information regarding copyright ownership.
5
+ # The ASF licenses this file to You under the Apache License, Version 2.0
6
+ # (the "License"); you may not use this file except in compliance with
7
+ # the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ name : " integrate-test"
19
+
20
+ on :
21
+ # Triggers the workflow on push or pull request events but only for the master branch
22
+ push :
23
+ branches : [ master ]
24
+ pull_request :
25
+ branches : " *"
26
+
27
+ permissions :
28
+ contents : read
29
+
30
+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
31
+ jobs :
32
+ # This workflow contains a single job called "build"
33
+ test :
34
+ # The type of runner that the job will run on
35
+ name : test
36
+ runs-on : ubuntu-latest
37
+ strategy :
38
+ matrix :
39
+ golang :
40
+ - 1.18
41
+
42
+ steps :
43
+
44
+ - name : " set up go"
45
+ uses : actions/setup-go@v3
46
+ with :
47
+ go-version : 1.18
48
+
49
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
50
+ - name : " checkout ${{ github.ref }}"
51
+ uses : actions/checkout@v3
52
+
53
+ - name : Cache dependencies
54
+ uses : actions/cache@v3
55
+ with :
56
+ # Cache
57
+ path : ~/go/pkg/mod
58
+ # Cache key
59
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
60
+ # An ordered list of keys to use for restoring the cache if no cache hit occurred for key
61
+ restore-keys : |
62
+ ${{ runner.os }}-go-
63
+
64
+ # This step only runs when the event type is a pull_request
65
+ - name : Integrate Test
66
+ if : ${{ github.event_name == 'pull_request' }}
67
+ run : |
68
+ chmod +x integrate_test.sh && [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] && [[ -n "${{github.event.pull_request.head.sha}}" ]] && [[ -n "${{github.base_ref}}" ]] && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}}
69
+
70
+ # This step only runs when the event type is a push
71
+ - name : Integrate Test
72
+ if : ${{ github.event_name == 'push' }}
73
+ run : |
74
+ chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
0 commit comments