|
1 | 1 | name: grpc |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | branches: |
|
9 | 8 | branches: |
10 | 9 | - master |
11 | 10 | - stable |
12 | | - |
13 | 11 | jobs: |
14 | 12 | grpc_test: |
15 | 13 | name: gRPC plugin (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}}) |
16 | 14 | runs-on: ${{ matrix.os }} |
17 | 15 | timeout-minutes: 60 |
18 | 16 | strategy: |
19 | 17 | matrix: |
20 | | - php: [ "8.4" ] |
21 | | - go: [ stable ] |
22 | | - os: [ "ubuntu-latest" ] |
| 18 | + php: ["8.5"] |
| 19 | + go: [stable] |
| 20 | + os: ["ubuntu-latest"] |
23 | 21 | steps: |
24 | 22 | - name: Set up Go ${{ matrix.go }} |
25 | 23 | uses: actions/setup-go@v5 # action page: <https://github.com/actions/setup-go> |
26 | 24 | with: |
27 | 25 | go-version: ${{ matrix.go }} |
28 | | - |
29 | 26 | - name: Set up PHP ${{ matrix.php }} |
30 | 27 | uses: shivammathur/setup-php@v2 # action page: <https://github.com/shivammathur/setup-php> |
31 | 28 | with: |
32 | 29 | php-version: ${{ matrix.php }} |
33 | 30 | extensions: sockets |
34 | | - |
35 | 31 | - name: Check out code |
36 | 32 | uses: actions/checkout@v4 |
37 | | - |
38 | 33 | - name: Get Composer Cache Directory |
39 | 34 | id: composer-cache |
40 | 35 | run: | |
41 | 36 | cd tests/php_test_files |
42 | 37 | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
43 | | -
|
44 | 38 | - name: Init Composer Cache # Docs: <https://git.io/JfAKn#php---composer> |
45 | 39 | uses: actions/cache@v4 |
46 | 40 | with: |
47 | 41 | path: ${{ steps.composer-cache.outputs.dir }} |
48 | 42 | key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }} |
49 | 43 | restore-keys: ${{ runner.os }}-composer- |
50 | | - |
51 | 44 | - name: Install Composer dependencies |
52 | 45 | run: cd tests/php_test_files && composer update --prefer-dist --no-progress --ansi |
53 | | - |
54 | 46 | - name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules> |
55 | 47 | uses: actions/cache@v4 |
56 | 48 | with: |
57 | 49 | path: ~/go/pkg/mod |
58 | 50 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
59 | 51 | restore-keys: ${{ runner.os }}-go- |
60 | | - |
61 | 52 | - name: Install Go dependencies |
62 | 53 | run: go mod download |
63 | | - |
64 | 54 | - name: Create folders |
65 | 55 | run: | |
66 | 56 | mkdir ./tests/coverage-ci |
67 | | -
|
68 | 57 | - name: Install protoc |
69 | 58 | uses: arduino/setup-protoc@v3 |
70 | 59 | with: |
71 | 60 | repo-token: ${{ secrets.GITHUB_TOKEN }} |
72 | | - |
73 | 61 | - name: Run golang root module tests |
74 | 62 | run: | |
75 | 63 | go test -timeout 20m -v -race -cover -tags=debug -failfast -coverpkg=$(cat ./tests/pkgs.txt) -coverprofile=./tests/coverage-ci/grpc_root.out -covermode=atomic ./codec ./parser ./protoc_plugins ./proxy |
76 | | -
|
77 | 64 | - name: Run ee tests with coverage |
78 | | - run: | |
79 | | - cd tests |
80 | | - |
81 | | - sudo apt update |
82 | | - sudo apt install -y libnss3-tools |
83 | | - curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" |
84 | | - chmod +x mkcert-v*-linux-amd64 |
85 | | - sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert |
86 | | - mkcert -install |
87 | | - mkcert localhost 127.0.0.1 ::1 |
88 | | - mkcert -client localhost 127.0.0.1 ::1 |
89 | | - mkdir test-certs |
90 | | - cp -r localhost+2-client-key.pem localhost+2-client.pem localhost+2-key.pem localhost+2.pem test-certs/ |
91 | | - cp -r $(mkcert -CAROOT)/rootCA.pem test-certs/ |
92 | | - |
93 | | - docker compose -f env/docker-compose-otel.yaml up -d |
94 | | - sleep 30 |
95 | | - go test -timeout 20m -v -race -cover -tags=debug -failfast -coverpkg=$(cat pkgs.txt) -coverprofile=./coverage-ci/grpc.out -covermode=atomic grpc_plugin_gzip_test.go grpc_plugin_test.go |
96 | | -
|
97 | | - docker compose -f env/docker-compose-otel.yaml down |
98 | | -
|
| 65 | + run: "cd tests\n\nsudo apt update\nsudo apt install -y libnss3-tools\ncurl -JLO \"https://dl.filippo.io/mkcert/latest?for=linux/amd64\"\nchmod +x mkcert-v*-linux-amd64\nsudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert\nmkcert -install\nmkcert localhost 127.0.0.1 ::1\nmkcert -client localhost 127.0.0.1 ::1 \nmkdir test-certs\ncp -r localhost+2-client-key.pem localhost+2-client.pem localhost+2-key.pem localhost+2.pem test-certs/\ncp -r $(mkcert -CAROOT)/rootCA.pem test-certs/\n\ndocker compose -f env/docker-compose-otel.yaml up -d\nsleep 30\ngo test -timeout 20m -v -race -cover -tags=debug -failfast -coverpkg=$(cat pkgs.txt) -coverprofile=./coverage-ci/grpc.out -covermode=atomic grpc_plugin_gzip_test.go grpc_plugin_test.go\n\ndocker compose -f env/docker-compose-otel.yaml down\n" |
99 | 66 | - name: Archive code coverage results |
100 | 67 | uses: actions/upload-artifact@v4 |
101 | 68 | with: |
102 | 69 | name: coverage |
103 | 70 | path: ./tests/coverage-ci |
104 | | - |
105 | | - |
106 | 71 | codecov: |
107 | 72 | name: Upload codecov |
108 | 73 | runs-on: ubuntu-latest |
109 | 74 | needs: |
110 | 75 | - grpc_test |
111 | | - |
112 | 76 | timeout-minutes: 60 |
113 | 77 | steps: |
114 | 78 | - name: Download code coverage results |
|
117 | 81 | echo 'mode: atomic' > summary.txt |
118 | 82 | tail -q -n +2 *.out >> summary.txt |
119 | 83 | sed -i '2,${/roadrunner/!d}' summary.txt |
120 | | -
|
121 | 84 | - name: upload to codecov |
122 | 85 | uses: codecov/codecov-action@v5 # Docs: <https://github.com/codecov/codecov-action> |
123 | 86 | with: |
|
0 commit comments