diff options
author | Valery Piashchynski <[email protected]> | 2020-12-15 14:28:30 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-15 14:28:30 +0300 |
commit | 21b51367e27f5a1b166459a115e4655d07a5d832 (patch) | |
tree | c3257a2ac38f0688e78ca2c9eeb160fb7a84c55d /.github | |
parent | 08f073f3bdc1288db68235c098c3a2109c6e7667 (diff) | |
parent | d39a0735fe21d21c5aae20c4780458433a42250a (diff) |
Merge branch '2.0' into plugin/reloader
# Conflicts:
# go.mod
# sync_worker.go
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cc0291c..070350a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,55 +5,16 @@ on: pull_request: jobs: - php: - name: Build (PHP ${{ matrix.php }}, ${{ matrix.setup }} setup) - runs-on: ubuntu-20.04 - timeout-minutes: 6 - strategy: - fail-fast: false - matrix: - php: [ '7.4', '8.0' ] - setup: [ basic, lowest ] - steps: - - name: Set up PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 # action page: <https://github.com/shivammathur/setup-php> - with: - php-version: ${{ matrix.php }} - - - name: Check out code - uses: actions/checkout@v2 - - - name: Syntax check only (lint) - run: find ./src/ ./tests/ -name "*.php" -print0 | xargs -0 -n1 -P8 php -l - - - name: Get Composer Cache Directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Init Composer Cache # Docs: <https://git.io/JfAKn#php---composer> - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install lowest Composer dependencies - if: matrix.setup == 'lowest' - run: composer update --prefer-dist --no-progress --prefer-lowest --ansi - - - name: Install basic Composer dependencies - if: matrix.setup == 'basic' - run: composer update --prefer-dist --no-progress --ansi - golang: - name: Build (Go ${{ matrix.go }}, PHP ${{ matrix.php }}) - runs-on: ubuntu-20.04 - timeout-minutes: 10 + name: Build (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}}) + runs-on: ${{ matrix.os }} + timeout-minutes: 15 strategy: fail-fast: false matrix: php: [ '7.4', '8.0' ] go: [ '1.14', '1.15' ] + os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v2 # action page: <https://github.com/actions/setup-go> @@ -64,15 +25,18 @@ jobs: uses: shivammathur/setup-php@v2 # action page: <https://github.com/shivammathur/setup-php> with: php-version: ${{ matrix.php }} + extensions: sockets - name: Check out code uses: actions/checkout@v2 - name: Get Composer Cache Directory + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Init Composer Cache # Docs: <https://git.io/JfAKn#php---composer> + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} @@ -80,7 +44,7 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install Composer dependencies - run: composer update --prefer-dist --no-progress --ansi + run: cd tests && composer update --prefer-dist --no-progress --ansi - name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules> uses: actions/cache@v2 @@ -92,7 +56,28 @@ jobs: - name: Install Go dependencies run: go mod download - - name: Run golang tests + - name: Run golang tests on Windows without codecov + if: ${{ matrix.os == 'windows-latest' }} + run: | + go test -v -race -cover -tags=debug . + go test -v -race -cover -tags=debug ./plugins/rpc + go test -v -race -cover -tags=debug ./plugins/rpc/tests + go test -v -race -cover -tags=debug ./plugins/config/tests + go test -v -race -cover -tags=debug ./plugins/logger/tests + go test -v -race -cover -tags=debug ./plugins/server/tests + go test -v -race -cover -tags=debug ./plugins/metrics/tests + go test -v -race -cover -tags=debug ./plugins/informer/tests + go test -v -race -cover -tags=debug ./plugins/resetter/tests + go test -v -race -cover -tags=debug ./plugins/http/attributes + go test -v -race -cover -tags=debug ./plugins/http/tests + go test -v -race -cover -tags=debug ./plugins/gzip/tests + go test -v -race -cover -tags=debug ./plugins/static/tests + go test -v -race -cover -tags=debug ./plugins/static + go test -v -race -cover -tags=debug ./plugins/headers/tests + go test -v -race -cover -tags=debug ./plugins/checker/tests + + - name: Run golang tests on Linux and MacOS + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} run: | mkdir ./coverage-ci go test -v -race -cover -tags=debug -coverprofile=./coverage-ci/lib.txt -covermode=atomic . @@ -114,6 +99,7 @@ jobs: cat ./coverage-ci/*.txt > ./coverage-ci/summary.txt - uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action> + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage-ci/summary.txt |