From 7563767d8c66a22e935aa4411bc1960504968fe2 Mon Sep 17 00:00:00 2001 From: Smolevich Date: Mon, 11 Nov 2019 07:58:19 +0300 Subject: Update ci file and rename --- .github/workflows/ci-build.yml | 87 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/ci-build.yml (limited to '.github/workflows/ci-build.yml') diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 00000000..e3a90392 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,87 @@ +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 env + 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 -coverprofilevers=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: | + 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 -- cgit v1.2.3 From f03015ab9ecc95fbd06c8f9fe33f3d9f28a53422 Mon Sep 17 00:00:00 2001 From: Smolevich Date: Mon, 11 Nov 2019 08:16:03 +0300 Subject: Remove line --- .github/workflows/ci-build.yml | 1 - 1 file changed, 1 deletion(-) (limited to '.github/workflows/ci-build.yml') diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index e3a90392..586bb264 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -58,7 +58,6 @@ jobs: - name: Run golang tests run: | - go env 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 -- cgit v1.2.3 From d2781e04318726d8b9fb1ad9903d58b1ab3eb741 Mon Sep 17 00:00:00 2001 From: Smolevich Date: Wed, 13 Nov 2019 00:04:22 +0300 Subject: Fix incorrect name for flag --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows/ci-build.yml') diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 586bb264..e3392357 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -66,7 +66,7 @@ jobs: 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 -coverprofilevers=headers.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 -- cgit v1.2.3 From efd5f980c6c7b50678d3ad010eba2a1cca0b7d15 Mon Sep 17 00:00:00 2001 From: Smolevich Date: Wed, 13 Nov 2019 10:57:01 +0300 Subject: Add if condition for code coverage step --- .github/workflows/ci-build.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to '.github/workflows/ci-build.yml') diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index e3392357..3031cbb4 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -40,7 +40,7 @@ jobs: go env fi env: - DEBUG: ${{secrets.DEBUG}} + DEBUG: ${{ secrets.DEBUG }} - name: Show versions run: | @@ -71,16 +71,21 @@ jobs: go test ./service/health -race -v -coverprofile=health.txt -covermode=atomic - name: Run code coverage run: | - 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 + 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: -- cgit v1.2.3