ci.yml 2.1 KB
Newer Older
1
name: CI
何延龙 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [ubuntu-latest]
        php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
    name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
    steps:
何延龙 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
      - name: Checkout
        uses: actions/checkout@v2
        with:
          path: skywalking-php

      - name: Checkout agent test tool
        uses: actions/checkout@v2
        with:
          repository: apache/skywalking-agent-test-tool
          path: skywalking-agent-test-tool

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-versions }}
          extensions: curl, json

      - name: Setup java
        uses: actions/setup-java@v1
何延龙 已提交
37 38
        with:
          java-version: 8
何延龙 已提交
39 40 41 42 43 44 45

      - name: Setup maven
        uses: aahmed-se/setup-maven@v3
        with:
          maven-version: 3.6.1
      - name: Setup GO
        uses: actions/setup-go@v2-beta
何延龙 已提交
46 47
        with:
          go-version: '^1.13.1'
何延龙 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61

      - name: Install library
        run: sudo apt-get update && sudo apt-get install -y curl libcurl4-openssl-dev

      - name: Build SkyWalking-PHP
        run: |
          cd skywalking-php
          phpize
          ./configure
          make
          sudo make install
          cd ..

      - name: Build SkyWalking-PHP agent
何延龙 已提交
62
        run: |
何延龙 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
          cd skywalking-php
          bash -c './build-sky-php-agent.sh'
          cd ..
          
      - name: Start apache SkyWalking mock collector
        run: |
          cd skywalking-agent-test-tool
          mvn package -DskipTests
          tar zxvf ./dist/skywalking-mock-collector.tar.gz -C ./mock-collector
          cd ./mock-collector/skywalking-mock-collector
          nohup bash -c './bin/collector-startup.sh' &
          cd ../..

      - name: Check mock collector
        run: bash -c 'response=0; while [ $response -ne 200 ]; do sleep 1; response=$(curl --write-out %{http_code} --silent --output /dev/null http://localhost:12800/receiveData);echo $response;done'