mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 06:50:18 +00:00
3bbb25bd64
* Update docker-compose to use SuperMQ Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Remove duplicate services Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update Bootstrap Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update other services to use SMQ Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Switch config prefix to SMQ Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Remove leftovers Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Remove duplicate interface definitions Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Remove unused actions Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Remove unused API docs Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Resolve linter comments Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Fix provision Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> --------- Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
144 lines
4.0 KiB
YAML
144 lines
4.0 KiB
YAML
# Copyright (c) Abstract Machines
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: CI Pipeline
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
lint-and-build: # Linting and building are combined to save time for setting up Go
|
|
name: Lint and Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22.x
|
|
cache-dependency-path: "go.sum"
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.60.3
|
|
args: --config ./tools/config/golangci.yml
|
|
|
|
- name: Build all Binaries
|
|
run: |
|
|
make all -j $(nproc)
|
|
|
|
run-tests:
|
|
name: Run tests
|
|
runs-on: ubuntu-latest
|
|
needs: lint-and-build
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.22.x
|
|
cache-dependency-path: "go.sum"
|
|
|
|
- name: Check for changes in specific paths
|
|
uses: dorny/paths-filter@v3
|
|
id: changes
|
|
with:
|
|
base: main
|
|
filters: |
|
|
workflow:
|
|
- ".github/workflows/tests.yml"
|
|
|
|
bootstrap:
|
|
- "bootstrap/**"
|
|
- "cmd/bootstrap/**"
|
|
- "auth.pb.go"
|
|
- "auth_grpc.pb.go"
|
|
- "auth/**"
|
|
- "pkg/sdk/**"
|
|
- "pkg/events/**"
|
|
|
|
consumers:
|
|
- "consumers/**"
|
|
- "cmd/postgres-writer/**"
|
|
- "cmd/timescale-writer/**"
|
|
- "cmd/smpp-notifier/**"
|
|
- "cmd/smtp-notifier/**"
|
|
|
|
internal:
|
|
- "internal/**"
|
|
|
|
pkg-errors:
|
|
- "pkg/errors/**"
|
|
|
|
pkg-events:
|
|
- "pkg/events/**"
|
|
- "pkg/messaging/**"
|
|
|
|
provision:
|
|
- "provision/**"
|
|
- "cmd/provision/**"
|
|
- "logger/**"
|
|
- "pkg/sdk/**"
|
|
|
|
readers:
|
|
- "readers/**"
|
|
- "cmd/postgres-reader/**"
|
|
- "cmd/timescale-reader/**"
|
|
- "auth.pb.go"
|
|
- "auth_grpc.pb.go"
|
|
- "things/**"
|
|
- "auth/**"
|
|
|
|
- name: Create coverage directory
|
|
run: |
|
|
mkdir coverage
|
|
|
|
- name: Run bootstrap tests
|
|
if: steps.changes.outputs.bootstrap == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/bootstrap.out ./bootstrap/...
|
|
|
|
- name: Run consumers tests
|
|
if: steps.changes.outputs.consumers == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/consumers.out ./consumers/...
|
|
|
|
- name: Run internal tests
|
|
if: steps.changes.outputs.internal == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/internal.out ./internal/...
|
|
|
|
- name: Run pkg errors tests
|
|
if: steps.changes.outputs.pkg-errors == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/pkg-errors.out ./pkg/errors/...
|
|
|
|
- name: Run provision tests
|
|
if: steps.changes.outputs.provision == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/provision.out ./provision/...
|
|
|
|
- name: Run readers tests
|
|
if: steps.changes.outputs.readers == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/readers.out ./readers/...
|
|
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV }}
|
|
files: ./coverage/*.out
|
|
codecov_yml_path: tools/codecov.yml
|
|
verbose: true
|