mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-24 13:48:49 +08:00
NOISSUE - Fix CI setup (#1928)
* Update CI script Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Update Protoc version on CI Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> --------- Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
This commit is contained in:
parent
6726bc7744
commit
ea851cf12c
@ -28,16 +28,16 @@ blocks:
|
||||
- 'curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.53.3'
|
||||
- cache store linter ./bin/golangci-lint
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Check Generated Protocol Buffer Files
|
||||
dependencies: []
|
||||
run:
|
||||
when: "change_in(['things/policies/auth.proto', 'users/policies/auth.proto', 'pkg/messaging/message.proto'])"
|
||||
when: "change_in(['./auth.proto', 'pkg/messaging/message.proto'])"
|
||||
task:
|
||||
jobs:
|
||||
- name: Check Generated Protocol Buffer Files
|
||||
commands:
|
||||
- PROTOC_VERSION=23.3
|
||||
- PROTOC_VERSION=24.3
|
||||
- PROTOC_GEN_VERSION=v1.31.0
|
||||
- PROTOC_GRPC_VERSION=v1.3.0
|
||||
- PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip
|
||||
@ -56,27 +56,15 @@ blocks:
|
||||
|
||||
- |
|
||||
echo "Setting up Mainflux..."
|
||||
for p in $(ls users/policies/*.pb.go); do
|
||||
mv $p $p.tmp
|
||||
done
|
||||
for p in $(ls things/policies/*.pb.go); do
|
||||
for p in $(ls ./*.pb.go); do
|
||||
mv $p $p.tmp
|
||||
done
|
||||
for p in $(ls pkg/messaging/*.pb.go); do
|
||||
mv $p $p.tmp
|
||||
done
|
||||
- protoc -I. --go_out=. --go_opt=paths=source_relative pkg/messaging/*.proto
|
||||
- protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative users/policies/*.proto
|
||||
- protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative things/policies/*.proto
|
||||
- make proto
|
||||
- |
|
||||
for p in $(ls users/policies/*.pb.go); do
|
||||
if ! cmp -s $p $p.tmp; then
|
||||
echo "Proto file and generated Go file $p are out of sync!"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
- |
|
||||
for p in $(ls things/policies/*.pb.go); do
|
||||
for p in $(ls ./*.pb.go); do
|
||||
if ! cmp -s $p $p.tmp; then
|
||||
echo "Proto file and generated Go file $p are out of sync!"
|
||||
exit 1
|
||||
@ -91,7 +79,7 @@ blocks:
|
||||
done
|
||||
- name: Lint and Test Users
|
||||
run:
|
||||
when: "change_in(['users', 'cmd/users', 'things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['users', 'cmd/users', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -110,7 +98,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Users
|
||||
dependencies:
|
||||
- Lint and Test Users
|
||||
@ -125,7 +113,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test Things
|
||||
run:
|
||||
when: "change_in(['things', 'cmd/things', 'things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['things', 'cmd/things', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -144,7 +132,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Things
|
||||
dependencies:
|
||||
- Lint and Test Things
|
||||
@ -159,7 +147,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test CoAP
|
||||
run:
|
||||
when: "change_in(['coap', 'cmd/coap','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go', 'things/policies/service.go'])"
|
||||
when: "change_in(['coap', 'cmd/coap', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -178,7 +166,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build CoAP
|
||||
dependencies:
|
||||
- Lint and Test CoAP
|
||||
@ -193,7 +181,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test HTTP
|
||||
run:
|
||||
when: "change_in(['http', 'cmd/http', 'things/policies/postgres', 'things/policies/service.go'])"
|
||||
when: "change_in(['http', 'cmd/http', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -212,7 +200,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build HTTP
|
||||
dependencies:
|
||||
- Lint and Test HTTP
|
||||
@ -228,7 +216,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test MQTT
|
||||
run:
|
||||
when: "change_in(['mqtt', 'cmd/mqtt', 'things/policies/postgres', 'things/policies/service.go','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['mqtt', 'cmd/mqtt', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -247,7 +235,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build MQTT
|
||||
dependencies:
|
||||
- Lint and Test MQTT
|
||||
@ -263,7 +251,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test WS
|
||||
run:
|
||||
when: "change_in(['ws', 'cmd/ws', 'things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['ws', 'cmd/ws', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -282,12 +270,12 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build WS
|
||||
dependencies:
|
||||
- Lint and Test WS
|
||||
run:
|
||||
when: "change_in(['ws', 'cmd/ws','things/policies/postgres', 'things/policies/service.go'])"
|
||||
when: "change_in(['ws', 'cmd/ws', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
task:
|
||||
jobs:
|
||||
- name: Build WS
|
||||
@ -317,7 +305,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Bootstrap
|
||||
dependencies:
|
||||
- Lint and Test Bootstrap
|
||||
@ -333,7 +321,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test Certs
|
||||
run:
|
||||
when: "change_in(['certs', 'cmd/certs','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['certs', 'cmd/certs', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -352,7 +340,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Certs
|
||||
dependencies:
|
||||
- Lint and Test Certs
|
||||
@ -387,12 +375,12 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Provision
|
||||
dependencies:
|
||||
- Lint and Test Provision
|
||||
run:
|
||||
when: "change_in(['provision', 'cmd/provision','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['provision', 'cmd/provision', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
task:
|
||||
jobs:
|
||||
- name: Build Provision
|
||||
@ -403,7 +391,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test Twins
|
||||
run:
|
||||
when: "change_in(['twins', 'cmd/twins','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['twins', 'cmd/twins', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -422,7 +410,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Twins
|
||||
dependencies:
|
||||
- Lint and Test Twins
|
||||
@ -438,7 +426,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test Readers
|
||||
run:
|
||||
when: "change_in(['/readers','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go', 'cmd/cassandra-reader', 'cmd/influxdb-reader', 'cmd/mongodb-reader', 'cmd/postgres-reader', 'cmd/timescale-reader', 'things/policies/service.go'])"
|
||||
when: "change_in(['/readers', 'cmd/cassandra-reader', 'cmd/influxdb-reader', 'cmd/mongodb-reader', 'cmd/postgres-reader', 'cmd/timescale-reader', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -457,12 +445,12 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Readers
|
||||
dependencies:
|
||||
- Lint and Test Readers
|
||||
run:
|
||||
when: "change_in(['readers', 'cmd/cassandra-reader', 'cmd/influxdb-reader', 'cmd/mongodb-reader', 'cmd/postgres-reader', 'cmd/timescale-reader' ])"
|
||||
when: "change_in(['readers', 'cmd/cassandra-reader', 'cmd/influxdb-reader', 'cmd/mongodb-reader', 'cmd/postgres-reader', 'cmd/timescale-reader', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
task:
|
||||
jobs:
|
||||
- name: Build Readers
|
||||
@ -477,7 +465,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test Consumers
|
||||
run:
|
||||
when: "change_in(['consumers','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go', 'cmd/cassandra-writer', 'cmd/influxdb-writer', 'cmd/mongodb-writer', 'cmd/postgres-writer', 'cmd/timescale-writer', 'cmd/smpp-notifier', 'cmd/smtp-notifier'])"
|
||||
when: "change_in(['consumers', 'cmd/cassandra-writer', 'cmd/influxdb-writer', 'cmd/mongodb-writer', 'cmd/postgres-writer', 'cmd/timescale-writer', 'cmd/smpp-notifier', 'cmd/smtp-notifier', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -496,12 +484,12 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build Consumers
|
||||
dependencies:
|
||||
- Lint and Test Consumers
|
||||
run:
|
||||
when: "change_in(['consumers', 'cmd/cassandra-writer', 'cmd/influxdb-writer', 'cmd/mongodb-writer', 'cmd/postgres-writer', 'cmd/timescale-writer', 'cmd/smpp-notifier', 'cmd/smtp-notifier'])"
|
||||
when: "change_in(['consumers', 'cmd/cassandra-writer', 'cmd/influxdb-writer', 'cmd/mongodb-writer', 'cmd/postgres-writer', 'cmd/timescale-writer', 'cmd/smpp-notifier', 'cmd/smtp-notifier', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
task:
|
||||
jobs:
|
||||
- name: Build Consumers
|
||||
@ -536,7 +524,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build CLI
|
||||
dependencies:
|
||||
- Lint and Test CLI
|
||||
@ -571,7 +559,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build LoRa
|
||||
dependencies:
|
||||
- Lint and Test LoRa
|
||||
@ -587,7 +575,7 @@ blocks:
|
||||
- name: docker_hub
|
||||
- name: Lint and Test OPC-UA
|
||||
run:
|
||||
when: "change_in(['/opcua', 'cmd/opcua','things/policies/postgres/policies.go', 'things/policies/api/grpc/client.go'])"
|
||||
when: "change_in(['/opcua', 'cmd/opcua', 'things/api/grpc', 'auth/service.go', 'auth/api/grpc/client.go'])"
|
||||
dependencies:
|
||||
- Setup
|
||||
- Check Generated Protocol Buffer Files
|
||||
@ -606,7 +594,7 @@ blocks:
|
||||
- cache restore codecov
|
||||
- ./codecov
|
||||
secrets:
|
||||
- name: CODECOV_TOKEN
|
||||
- name: codecov
|
||||
- name: Build OPC-UA
|
||||
dependencies:
|
||||
- Lint and Test OPC-UA
|
||||
|
Loading…
x
Reference in New Issue
Block a user