summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Titov <[email protected]>2019-11-14 17:41:42 +0300
committerGitHub <[email protected]>2019-11-14 17:41:42 +0300
commitb81f2b121eb3a49372662d0bc9c19c53366f33fc (patch)
tree2795eec5ad5132acfc6b5054a2103c9d9c46cc13
parentb4b1d63e02895e241447b75bbe7f755191c47227 (diff)
parentefd5f980c6c7b50678d3ad010eba2a1cca0b7d15 (diff)
Merge pull request #200 from Smolevich/add-support-for-github-actions
Add support for GitHub actions
-rw-r--r--.github/workflows/ci-build.yml91
1 files changed, 91 insertions, 0 deletions
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
new file mode 100644
index 00000000..3031cbb4
--- /dev/null
+++ b/.github/workflows/ci-build.yml
@@ -0,0 +1,91 @@
+name: CI
+
+on:
+ push:
+ branches:
+ tags:
+ pull_request:
+
+jobs:
+
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php: [7.1, 7.2, 7.3, 7.4]
+ steps:
+
+ - name: Set up Go 1.12
+ uses: actions/setup-go@v1
+ with:
+ go-version: 1.12
+ id: go
+
+ - name: Check out code into the Go module directory
+ uses: actions/checkout@v1
+
+ - name: Install PHP
+ uses: shivammathur/setup-php@master
+ with:
+ php-version: ${{ matrix.php }}
+ extension-csv: dom
+ coverage: xdebug
+
+ - name: Debug if needed
+ run: |
+ export DEBUG=${DEBUG:-false}
+ if [[ "$DEBUG" == "true" ]]; then
+ env
+ go env
+ fi
+ env:
+ DEBUG: ${{ secrets.DEBUG }}
+
+ - name: Show versions
+ run: |
+ php -v
+ composer -V
+ go version
+
+ - name: Install dependencies and download binary roadrunner
+ run: |
+ export GO111MODULE=on
+ go mod download
+ composer install --no-interaction --prefer-source
+ find src/ -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
+ chmod +x bin/rr && bin/rr get-binary
+
+ - name: Run golang tests
+ run: |
+ go test -race -v -coverprofile=lib.txt -covermode=atomic
+ go test ./util -race -v -coverprofile=util.txt -covermode=atomic
+ go test ./service -race -v -coverprofile=service.txt -covermode=atomic
+ go test ./service/env -race -v -coverprofile=env.txt -covermode=atomic
+ go test ./service/rpc -race -v -coverprofile=rpc.txt -covermode=atomic
+ go test ./service/http -race -v -coverprofile=http.txt -covermode=atomic
+ go test ./service/static -race -v -coverprofile=static.txt -covermode=atomic
+ go test ./service/limit -race -v -coverprofile=limit.txt -covermode=atomic
+ go test ./service/headers -race -v -coverprofile=headers.txt -covermode=atomic
+ go test ./service/metrics -race -v -coverprofile=metrics.txt -covermode=atomic
+ go test ./service/health -race -v -coverprofile=health.txt -covermode=atomic
+ - name: Run code coverage
+ run: |
+ if [[ "$CODECOV_TOKEN" != "" ]]; then
+ curl https://codecov.io/bash -o codecov-bash
+ chmod +x codecov-bash
+ ./codecov-bash -f lib.txt
+ ./codecov-bash -f util.txt
+ ./codecov-bash -f service.txt
+ ./codecov-bash -f env.txt
+ ./codecov-bash -f rpc.txt
+ ./codecov-bash -f http.txt
+ ./codecov-bash -f static.txt
+ ./codecov-bash -f limit.txt
+ ./codecov-bash -f headers.txt
+ ./codecov-bash -f metrics.txt
+ ./codecov-bash -f health.txt
+ fi
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ if: