This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GHA
- Loading branch information
Showing
11 changed files
with
185 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: daily | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Linux | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
# Branches from forks have the form 'user:branch-name' so we only run | ||
# this job on pull_request events for branches that look like fork | ||
# branches. Without this we would end up running this job twice for non | ||
# forked PRs, once for the push and then once for opening the PR. | ||
- "**:**" | ||
|
||
jobs: | ||
golang: | ||
name: Build (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}}) | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ "7.2","7.3", "7.4", "8.0" ] | ||
go: [ "1.14", "1.15" ] | ||
os: [ ubuntu-20.04 ] | ||
steps: | ||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 # action page: <https://github.com/actions/setup-go> | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Set up PHP ${{ matrix.php }} | ||
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 | ||
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.php }}-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: composer update --prefer-dist --no-progress --ansi | ||
|
||
- name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules> | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
|
||
- name: Install Go dependencies | ||
run: go mod download | ||
|
||
- name: Run golang tests on Linux | ||
run: | | ||
mkdir ./coverage-ci | ||
go test -v -race -cover -coverpkg=./... -coverprofile=./coverage-ci/broadcast-ws.txt -covermode=atomic | ||
- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action> | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage-ci/broadcast-ws.txt | ||
fail_ci_if_error: false | ||
|
||
golangci-lint: | ||
name: Golang-CI (lint) | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run linter | ||
uses: golangci/golangci-lint-action@v2 # Action page: <https://github.com/golangci/golangci-lint-action> | ||
with: | ||
version: v1.35 # without patch version | ||
only-new-issues: false # show only new issues if it's a pull request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: macOS | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
# Branches from forks have the form 'user:branch-name' so we only run | ||
# this job on pull_request events for branches that look like fork | ||
# branches. Without this we would end up running this job twice for non | ||
# forked PRs, once for the push and then once for opening the PR. | ||
- "**:**" | ||
|
||
jobs: | ||
golang: | ||
name: Build (Go ${{ matrix.go }}, PHP ${{ matrix.php }}, OS ${{matrix.os}}) | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ "7.2","7.3", "7.4", "8.0" ] | ||
go: [ "1.14", "1.15" ] | ||
os: [ macos-latest ] | ||
steps: | ||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 # action page: <https://github.com/actions/setup-go> | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Set up PHP ${{ matrix.php }} | ||
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 | ||
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.php }}-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: composer update --prefer-dist --no-progress --ansi | ||
|
||
- name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules> | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
|
||
- name: Install Go dependencies | ||
run: go mod download | ||
|
||
- name: Run golang tests | ||
run: | | ||
mkdir ./coverage-ci | ||
go test -v -race -cover -coverpkg=./... -coverprofile=./coverage-ci/broadcast-ws.txt -covermode=atomic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.idea | ||
go.sum | ||
vendor | ||
vendor_php | ||
composer.lock | ||
.php_cs.cache | ||
tests/log.txt | ||
tests/log.txt |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"config": { | ||
"vendor-dir": "vendor_php" | ||
}, | ||
"require": { | ||
"php": ">=7.2", | ||
"ext-json": "*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module github.com/spiral/broadcast-ws | ||
|
||
go 1.12 | ||
go 1.15 | ||
|
||
require ( | ||
github.com/gorilla/websocket v1.4.2 | ||
github.com/prometheus/client_golang v1.7.1 | ||
github.com/sirupsen/logrus v1.6.0 | ||
github.com/spf13/cobra v1.0.0 | ||
github.com/spiral/broadcast/v2 v2.0.5-beta.1 | ||
github.com/spiral/broadcast/v2 v2.0.5 | ||
github.com/spiral/roadrunner v1.9.2 | ||
github.com/stretchr/testify v1.6.1 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters