2020-10-19 02:36:40 +00:00
|
|
|
name: Build and test
|
|
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
|
|
on:
|
2021-07-20 07:34:14 +00:00
|
|
|
push:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
|
|
|
- 'scripts/**'
|
|
|
|
- 'internal/**'
|
|
|
|
- 'cmd/**'
|
|
|
|
- 'build/**'
|
|
|
|
- '.github/workflows/main.yaml'
|
|
|
|
- '.env'
|
|
|
|
- docker-compose.yml
|
|
|
|
- Makefile
|
2021-09-01 07:59:11 +00:00
|
|
|
- go.mod
|
2021-07-20 07:34:14 +00:00
|
|
|
- '!**.md'
|
|
|
|
- '!build/ci/jenkins/**'
|
2020-10-19 02:36:40 +00:00
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2020-10-24 03:36:42 +00:00
|
|
|
- 'scripts/**'
|
2020-10-19 02:36:40 +00:00
|
|
|
- 'internal/**'
|
|
|
|
- 'cmd/**'
|
2020-11-16 13:11:52 +00:00
|
|
|
- 'build/**'
|
2020-10-27 07:51:16 +00:00
|
|
|
- '.github/workflows/main.yaml'
|
2020-11-14 08:01:12 +00:00
|
|
|
- '.env'
|
2020-10-19 02:36:40 +00:00
|
|
|
- docker-compose.yml
|
2020-11-03 03:25:47 +00:00
|
|
|
- Makefile
|
2021-09-01 07:59:11 +00:00
|
|
|
- go.mod
|
2020-10-19 02:36:40 +00:00
|
|
|
- '!**.md'
|
2021-05-14 10:23:30 +00:00
|
|
|
- '!build/ci/jenkins/**'
|
2020-10-19 02:36:40 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ubuntu:
|
2021-04-29 02:19:41 +00:00
|
|
|
name: Build and test AMD64 Ubuntu ${{ matrix.ubuntu }}
|
2021-12-21 04:05:18 +00:00
|
|
|
runs-on: ubuntu-${{ matrix.ubuntu }}
|
2021-04-26 05:59:28 +00:00
|
|
|
timeout-minutes: 90
|
2020-10-27 07:51:16 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ubuntu: [18.04]
|
|
|
|
env:
|
|
|
|
UBUNTU: ${{ matrix.ubuntu }}
|
2020-10-19 02:36:40 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-12-09 12:07:27 +00:00
|
|
|
- name: Cache CCache Volumes
|
2020-10-27 07:51:16 +00:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2020-12-09 12:07:27 +00:00
|
|
|
path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-ccache
|
|
|
|
key: ubuntu${{ matrix.ubuntu }}-ccache-${{ hashFiles('internal/core/**') }}
|
|
|
|
restore-keys: ubuntu${{ matrix.ubuntu }}-ccache-
|
|
|
|
- name: Cache Go Mod Volumes
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-go-mod
|
|
|
|
key: ubuntu${{ matrix.ubuntu }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: ubuntu${{ matrix.ubuntu }}-go-mod-
|
2020-11-09 10:47:37 +00:00
|
|
|
- name: Start Service
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-12-07 07:22:20 +00:00
|
|
|
docker-compose up -d pulsar etcd minio
|
2020-11-13 04:27:41 +00:00
|
|
|
- name: Build and UnitTest
|
2020-11-17 10:36:03 +00:00
|
|
|
env:
|
|
|
|
CHECK_BUILDER: "1"
|
2020-10-19 02:36:40 +00:00
|
|
|
run: |
|
2021-12-08 02:55:04 +00:00
|
|
|
./build/builder.sh /bin/bash -c "make check-proto-product && make codecov"
|
2022-01-21 07:45:39 +00:00
|
|
|
- name: Get pulsar/minio/etcd logs when ut failed
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run: |
|
|
|
|
echo "-------------logs for pulsar ---------------"
|
|
|
|
docker logs milvus_pulsar_1
|
|
|
|
echo "-------------logs for minio ----------------"
|
|
|
|
docker logs milvus_minio_1
|
|
|
|
echo "-------------logs for etcd ----------------"
|
|
|
|
docker logs milvus_etcd_1
|
2021-07-16 06:52:21 +00:00
|
|
|
- name: Upload coverage to Codecov
|
2021-11-23 22:49:15 +00:00
|
|
|
if: "github.repository == 'milvus-io/milvus'"
|
2021-09-24 08:41:55 +00:00
|
|
|
uses: codecov/codecov-action@v2
|
2021-07-16 06:52:21 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2021-10-19 06:52:34 +00:00
|
|
|
files: ./go_coverage.txt,./lcov_output.info
|
2021-07-16 06:52:21 +00:00
|
|
|
name: ubuntu-${{ matrix.ubuntu }}-unittests
|
2021-12-13 07:28:28 +00:00
|
|
|
fail_ci_if_error: true
|
|
|
|
|