main.yaml 1.7 KB
Newer Older
Z
zhenshan.cao 已提交
1 2 3 4 5 6 7 8
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:
  push:
    # file paths to consider in the event. Optional; defaults to all.
    paths:
9
      - 'scripts/**'
Z
zhenshan.cao 已提交
10 11
      - 'internal/**'
      - 'cmd/**'
Q
quicksilver 已提交
12
      - 'build/**'
Q
quicksilver 已提交
13
      - '.github/workflows/main.yaml'
14
      - '.env'
Z
zhenshan.cao 已提交
15
      - docker-compose.yml
C
cai.zhang 已提交
16
      - Makefile
Z
zhenshan.cao 已提交
17 18 19 20
      - '!**.md'
  pull_request:
    # file paths to consider in the event. Optional; defaults to all.
    paths:
21
      - 'scripts/**'
Z
zhenshan.cao 已提交
22 23
      - 'internal/**'
      - 'cmd/**'
Q
quicksilver 已提交
24
      - 'build/**'
Q
quicksilver 已提交
25
      - '.github/workflows/main.yaml'
26
      - '.env'
Z
zhenshan.cao 已提交
27
      - docker-compose.yml
C
cai.zhang 已提交
28
      - Makefile
Z
zhenshan.cao 已提交
29 30 31 32
      - '!**.md'

jobs:
  ubuntu:
Q
quicksilver 已提交
33 34 35 36 37 38 39 40 41
    name: AMD64 Ubuntu ${{ matrix.ubuntu }}
    runs-on: ubuntu-latest
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        ubuntu: [18.04]
    env:
      UBUNTU: ${{ matrix.ubuntu }}
Z
zhenshan.cao 已提交
42 43 44
    steps:
      - name: Checkout
        uses: actions/checkout@v2
Q
quicksilver 已提交
45 46
      - name: Check Dockerfile
        uses: reviewdog/action-hadolint@v1
Z
zhenshan.cao 已提交
47
        with:
Q
quicksilver 已提交
48 49
          github_token: ${{ secrets.GITHUB_TOKEN }}
          reporter: github-pr-check # Default is github-pr-check
50
          hadolint_ignore: DL3008
Q
quicksilver 已提交
51 52 53 54 55 56
      - name: Cache Docker Volumes
        uses: actions/cache@v1
        with:
          path: .docker
          key: ubuntu${{ matrix.ubuntu }}-${{ hashFiles('internal/core/**') }}
          restore-keys: ubuntu${{ matrix.ubuntu }}-
C
cai.zhang 已提交
57 58 59
      - name: Start Service
        shell: bash
        run: |
Q
quicksilver 已提交
60
          cd ${GITHUB_WORKSPACE}/deployments/docker && docker-compose -p milvus-distributed up -d
61
      - name: Build and UnitTest
Q
quicksilver 已提交
62 63
        env:
          CHECK_BUILDER: "1"
Z
zhenshan.cao 已提交
64
        run: |
65
          ./build/builder.sh