ci.yml 2.2 KB
Newer Older
1
name: CI
何延龙 已提交
2 3 4

on:
  push:
H
heyanlong 已提交
5 6 7 8
    branches:
      - master
    tags:
      - 'v*'
何延龙 已提交
9
  pull_request:
H
heyanlong 已提交
10 11
    branches:
      - master
何延龙 已提交
12 13 14 15 16 17 18 19 20 21

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:
何延龙 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
      - name: Checkout
        uses: actions/checkout@v2

      - 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
何延龙 已提交
39 40
        with:
          java-version: 8
何延龙 已提交
41 42 43 44 45 46 47

      - name: Setup maven
        uses: aahmed-se/setup-maven@v3
        with:
          maven-version: 3.6.1
      - name: Setup GO
        uses: actions/setup-go@v2-beta
何延龙 已提交
48 49
        with:
          go-version: '^1.13.1'
何延龙 已提交
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: |
          phpize
          ./configure
          make
          sudo make install
          bash -c './build-sky-php-agent.sh'
          
H
heyanlong 已提交
62
      - name: Build SkyWalking mock collector
何延龙 已提交
63 64 65 66 67 68
        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' &
H
heyanlong 已提交
69
          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'
何延龙 已提交
70

H
heyanlong 已提交
71
      - name: Publish Dokcer image
H
heyanlong 已提交
72
        if: matrix.php-versions == '7.4' && github.event == 'push'
H
heyanlong 已提交
73 74 75 76 77
        uses: elgohr/Publish-Docker-Github-Action@2.13
        with: 
          name: skyapm/skywalking-php
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}