|
|
@@ -0,0 +1,74 @@ |
|
|
|
# |
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more |
|
|
|
# contributor license agreements. See the NOTICE file distributed with |
|
|
|
# this work for additional information regarding copyright ownership. |
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0 |
|
|
|
# (the "License"); you may not use this file except in compliance with |
|
|
|
# the License. You may obtain a copy of the License at |
|
|
|
# |
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
|
|
|
# |
|
|
|
# Unless required by applicable law or agreed to in writing, software |
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
# See the License for the specific language governing permissions and |
|
|
|
# limitations under the License. |
|
|
|
# |
|
|
|
|
|
|
|
name: "integrate-test" |
|
|
|
|
|
|
|
on: |
|
|
|
# Triggers the workflow on push or pull request events but only for the master branch |
|
|
|
push: |
|
|
|
branches: [ master ] |
|
|
|
pull_request: |
|
|
|
branches: "*" |
|
|
|
|
|
|
|
permissions: |
|
|
|
contents: read |
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
|
|
|
jobs: |
|
|
|
# This workflow contains a single job called "build" |
|
|
|
test: |
|
|
|
# The type of runner that the job will run on |
|
|
|
name: test |
|
|
|
runs-on: ubuntu-latest |
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
golang: |
|
|
|
- 1.18 |
|
|
|
|
|
|
|
steps: |
|
|
|
|
|
|
|
- name: "set up go" |
|
|
|
uses: actions/setup-go@v3 |
|
|
|
with: |
|
|
|
go-version: 1.18 |
|
|
|
|
|
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
|
|
|
- name: "checkout ${{ github.ref }}" |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: Cache dependencies |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
# Cache |
|
|
|
path: ~/go/pkg/mod |
|
|
|
# Cache key |
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
|
|
|
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key |
|
|
|
restore-keys: | |
|
|
|
${{ runner.os }}-go- |
|
|
|
|
|
|
|
# This step only runs when the event type is a pull_request |
|
|
|
- name: Integrate Test |
|
|
|
if: ${{ github.event_name == 'pull_request' }} |
|
|
|
run: | |
|
|
|
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}} |
|
|
|
|
|
|
|
# This step only runs when the event type is a push |
|
|
|
- name: Integrate Test |
|
|
|
if: ${{ github.event_name == 'push' }} |
|
|
|
run: | |
|
|
|
chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF |