Skip to content

Commit

Permalink
[#136]: refacroring(project): merge activity,client, and `workflo…
Browse files Browse the repository at this point in the history
…w` plugins
  • Loading branch information
rustatian authored Dec 27, 2021
2 parents 85b555b + 1612808 commit c0520c8
Show file tree
Hide file tree
Showing 109 changed files with 3,369 additions and 3,734 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Linters

on: [push, pull_request]

jobs:
golangci-lint:
name: Golang-CI (lint)
runs-on: ubuntu-latest
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.43 # without patch version
only-new-issues: false # show only new issues if it's a pull request
args: --timeout=10m --build-tags=safe
16 changes: 5 additions & 11 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: true
matrix:
php: [ "7.4", "8.0", "8.1" ]
go: [ "1.17.4" ]
go: [ "1.17.5" ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go }}
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: cd tests && composer update --prefer-dist --no-progress --ansi
run: cd tests/php_test_files && composer update --prefer-dist --no-progress --ansi

- name: Init Go modules Cache # Docs: <https://git.io/JfAKn#go---modules>
uses: actions/cache@v2
Expand All @@ -64,17 +64,11 @@ jobs:
- name: Install Go dependencies
run: go mod tidy && go mod download

- name: Golang tests [Linux] with JSON and PROTO codecs
run: |
docker-compose -f ./tests/docker-compose.yaml up -d
mkdir ./coverage-ci
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/temporal.txt -covermode=atomic ./tests
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/temporal_protocol.txt -covermode=atomic ./protocol
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage-ci/temporal_workflow.txt -covermode=atomic ./workflow
docker-compose -f ./tests/docker-compose.yaml down
cat ./coverage-ci/*.txt > ./coverage-ci/summary.txt
- name: Golang tests
run: make test_coverage

- uses: codecov/codecov-action@v1 # Docs: <https://github.com/codecov/codecov-action>
if: ${{ !env.ACT }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage-ci/summary.txt
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# vendor/
.idea

tests/composer.lock
tests/vendor
config
go.sum
**/composer.json
**/composer.lock
**/vendor
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "proto/api"]
path = proto/api
url = https://github.com/temporalio/api
121 changes: 0 additions & 121 deletions CHANGELOG.md

This file was deleted.

34 changes: 24 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,30 @@ stop-docker-compose:

# Installs all needed composer dependencies
install-dependencies:
go get -u golang.org/x/lint/golint
composer --working-dir=./test/ install
composer --working-dir=./tests/php_test_files install

# Run integration tests
test-feature:
go test -v -race -tags=debug ./tests
# Run all tests and code-style checks
test:
docker-compose -f tests/env/docker-compose.yaml up -d --remove-orphans
sleep 20
go test -v -race -cover -tags=debug -failfast ./tests
go test -v -race -cover -tags=debug -failfast ./internal/data_converter
go test -v -race -cover -tags=debug -failfast ./workflow/canceller
go test -v -race -cover -tags=debug -failfast ./workflow/queue
docker compose -f tests/env/docker-compose.yaml down

test-unit:
go test -v -race -tags=debug ./protocol/
go test -v -race -tags=debug ./workflow
test_coverage:
docker-compose -f tests/env/docker-compose.yaml up -d --remove-orphans
rm -rf coverage-ci
mkdir ./coverage-ci
go test -v -race -cover -tags=debug -failfast -coverpkg=./... -coverprofile=./coverage-ci/temporal.out -covermode=atomic ./tests
go test -v -race -cover -tags=debug -failfast -coverpkg=./... -coverprofile=./coverage-ci/temporal_protocol.out -covermode=atomic ./internal/data_converter
go test -v -race -cover -tags=debug -failfast -coverpkg=./... -coverprofile=./coverage-ci/temporal_workflow.out -covermode=atomic ./workflow
go test -v -race -cover -tags=debug -failfast -coverpkg=./... -coverprofile=./coverage-ci/canceller.out -covermode=atomic ./workflow/canceller
go test -v -race -cover -tags=debug -failfast -coverpkg=./... -coverprofile=./coverage-ci/queue.out -covermode=atomic ./workflow/queue
echo 'mode: atomic' > ./coverage-ci/summary.txt
tail -q -n +2 ./coverage-ci/*.out >> ./coverage-ci/summary.txt
docker-compose -f tests/env/docker-compose.yaml down

# Run all tests and code-style checks
test: test-unit test-feature
generate-proto:
protoc -I./proto/api -I./proto --go_out=proto/protocol/v1 ./proto/protocol/v1/protocol.proto
Loading

0 comments on commit c0520c8

Please sign in to comment.