|
1 | 1 | name: gzip |
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 | gzip_test: |
15 | 13 | name: GZIP 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@v6 # 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@v6 |
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@v5 |
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@v5 |
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: Run golang tests with coverage |
65 | 55 | run: | |
66 | 56 | cd tests |
67 | 57 | mkdir ./coverage-ci |
68 | 58 |
|
69 | 59 | go test -timeout 20m -v -race -cover -tags=debug -failfast -coverpkg=$(cat pkgs.txt) -coverprofile=./coverage-ci/gzip.out -covermode=atomic plugin_test.go |
70 | | -
|
71 | 60 | - name: Archive code coverage results |
72 | 61 | uses: actions/upload-artifact@v6 |
73 | 62 | with: |
74 | 63 | name: coverage |
75 | | - path: ./tests/coverage-ci/gzip.out |
76 | | - |
| 64 | + path: ./tests/coverage-ci |
77 | 65 | codecov: |
78 | 66 | name: Upload codecov |
79 | 67 | runs-on: ubuntu-latest |
80 | 68 | needs: |
81 | 69 | - gzip_test |
82 | | - |
83 | 70 | timeout-minutes: 60 |
84 | 71 | steps: |
| 72 | + - name: Check out code |
| 73 | + uses: actions/checkout@v6 |
85 | 74 | - name: Download code coverage results |
86 | 75 | uses: actions/download-artifact@v7 |
| 76 | + with: |
| 77 | + name: coverage |
| 78 | + path: coverage |
87 | 79 | - run: | |
88 | 80 | echo 'mode: atomic' > summary.txt |
89 | | - tail -q -n +2 *.out >> summary.txt |
90 | | - sed -i '2,${/roadrunner/!d}' summary.txt |
91 | | -
|
| 81 | + tail -q -n +2 coverage/*.out >> summary.txt |
| 82 | + awk ' |
| 83 | + NR == 1 { print; next } |
| 84 | + /^github\.com\/roadrunner-server\/gzip\/v5\// { |
| 85 | + sub(/^github\.com\/roadrunner-server\/gzip\/v5\//, "", $0) |
| 86 | + print |
| 87 | + } |
| 88 | + ' summary.txt > summary.filtered.txt |
| 89 | + mv summary.filtered.txt summary.txt |
92 | 90 | - name: upload to codecov |
93 | 91 | uses: codecov/codecov-action@v5 # Docs: <https://github.com/codecov/codecov-action> |
94 | 92 | with: |
|
0 commit comments