mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:20:19 +00:00
be6d8deef7
* chore: update compose with supermq override Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: remove duplicate env variables Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * ci(check-license.yaml): ignore rabbitmq files Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor: add supermq docker file Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * feat: add update option to make file Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor(supermq-docker-compose.override.yml): fix errors in files Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor: add amend commit to fetch and update commands Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: add supermq dependency update script Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: update SuperMQ dependency files * fix: remove reverted changes to Makefile Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor(supermq.sh): remove git staging and commit from script Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: remove redundant docker config files Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: remove redundant files, update compose p[roject directory Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: update project dir path Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: update nginv env file variable, remove redundant nginx config files Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore: include journal and certs to mg compose Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor: update script to use sparse checkout and move docker files into ./docker/supermq-docker Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor: update docker compose file Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * feat(Makefile): add fetch_supermq to run recipe Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * refactor(supermq.sh): clean up Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * chore(go.mod): remove toolchain definition Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * ci(build.yml): add check for supermq dependency Signed-off-by: Felix Gateru <felix.gateru@gmail.com> * ci: move check to ci Signed-off-by: Felix Gateru <felix.gateru@gmail.com> --------- Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
185 lines
5.3 KiB
YAML
185 lines
5.3 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: Fetch supermq
|
|
run: |
|
|
make fetch_supermq
|
|
if [[ -n $(git status --porcelain docker/supermq-docker) ]]; then
|
|
echo "SuperMQ docker file is not up to date. Please update it"
|
|
git diff docker/supermq-docker
|
|
exit 1
|
|
else
|
|
exit 0
|
|
fi
|
|
|
|
- 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/**"
|
|
|
|
cli:
|
|
- "cli/**"
|
|
- "cmd/cli/**"
|
|
- "pkg/sdk/**"
|
|
|
|
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/**"
|
|
|
|
pkg-sdk:
|
|
- "pkg/sdk/**"
|
|
- "bootstrap/api/**"
|
|
- "consumers/notifiers/api/**"
|
|
|
|
provision:
|
|
- "provision/**"
|
|
- "cmd/provision/**"
|
|
- "logger/**"
|
|
- "pkg/sdk/**"
|
|
|
|
readers:
|
|
- "readers/**"
|
|
- "cmd/postgres-reader/**"
|
|
- "cmd/timescale-reader/**"
|
|
- "auth.pb.go"
|
|
- "auth_grpc.pb.go"
|
|
- "things/**"
|
|
- "auth/**"
|
|
|
|
re:
|
|
- "re/**"
|
|
- "cmd/re/**"
|
|
- "re/api/**"
|
|
|
|
- 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 cli tests
|
|
if: steps.changes.outputs.cli == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/cli.out ./cli/...
|
|
|
|
- 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 pkg sdk tests
|
|
if: steps.changes.outputs.pkg-sdk == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/pkg-sdk.out ./pkg/sdk/...
|
|
|
|
- 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: Run rule engine tests
|
|
if: steps.changes.outputs.re == 'true' || steps.changes.outputs.workflow == 'true'
|
|
run: |
|
|
go test --race -v -count=1 -coverprofile=coverage/re.out ./re/...
|
|
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV }}
|
|
files: ./coverage/*.out
|
|
codecov_yml_path: tools/codecov.yml
|
|
verbose: true
|