Skip to content

Commit

Permalink
chore: generate server arch graph for releases (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren authored Apr 25, 2023
1 parent e2b5354 commit 87332a7
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@ on:
- 'cli/**'

jobs:
backend-arch-graph:
name: Generate backend architecture graph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: 'go.work'
cache: true
cache-dependency-path: go.work
- name: install graph tool
run: |
mkdir /tmp/go-arch
cd /tmp/go-arch
curl -SLO https://github.com/mathnogueira/golang-arch-viewer/archive/refs/heads/master.zip
unzip master.zip
cd golang-arch-viewer-master
make
mv dist/go-arch /tmp/go-arch/go-arch
- name: generate graph
run: |
cd server
mkdir -p ../dist/
/tmp/go-arch/go-arch ../dist/architecture.png
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: architecture-graph
path: dist/architecture.png

build-web:
name: build web
Expand Down Expand Up @@ -145,6 +177,10 @@ jobs:
with:
name: tracetest-web
path: web/build/
- uses: actions/download-artifact@v3
with:
name: architecture-graph
path: dist/architecture.png

- uses: goreleaser/goreleaser-action@v4
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@ on:
- k8s/**

jobs:
backend-arch-graph:
name: Generate backend architecture graph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: 'go.work'
cache: true
cache-dependency-path: go.work
- name: install graph tool
run: |
mkdir /tmp/go-arch
cd /tmp/go-arch
curl -SLO https://github.com/mathnogueira/golang-arch-viewer/archive/refs/heads/master.zip
unzip master.zip
cd golang-arch-viewer-master
make
mv dist/go-arch /tmp/go-arch/go-arch
- name: generate graph
run: |
cd server
mkdir -p ../dist/
/tmp/go-arch/go-arch ../dist/architecture.png
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: architecture-graph
path: dist/architecture.png

unit-test-cli:
name: CLI unit tests
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ release:
# discussion_category_name: General
draft: false
prerelease: "true"
extra_files:
- glob: ./dist/architecture.png
before:
hooks:
- dir: ./server
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ release:
# discussion_category_name: General
draft: false
prerelease: auto
extra_files:
- glob: ./dist/architecture.png
before:
hooks:
- dir: ./server
Expand Down
134 changes: 134 additions & 0 deletions server/arch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: tracetest

style:
core:
color: "#c9e6be"
infrastructure:
color: "#a1bbe3"
mixed:
color: "#de957f"


modules:

main:
type: infrastructure
group: startup

cmd:
type: infrastructure
group: startup

config/*:
type: core
group: config

expression/*:
type: core
group: assertion_engine

assertions/*:
type: core
group: assertion_engine

executor/*:
type: core
group: test_runner

tracedb/*:
type: core
group: test_runner

otlp/*:
type: mixed
group: otlp_ingestor

http/websocket:
type: infrastructure
group: notification

subscription:
type: infrastructure
group: notification

http:
type: infrastructure
group: api

http/validation:
type: infrastructure
group: api

openapi:
type: infrastructure
group: api

http/mappings:
type: infrastructure
group: api

junit:
type: infrastructure
group: api

model/yaml/*:
type: infrastructure
group: api

analytics:
type: infrastructure
group: observability

tracing:
type: infrastructure
group: observability

id:
type: infrastructure
group: libraries

resourcemanager:
type: infrastructure
group: libraries

testdb:
type: infrastructure
group: persistence

migrations:
type: infrastructure
group: persistence

app:
type: infrastructure
group: startup

provisioning:
type: infrastructure
group: startup

model:
type: core
group: models

model/events:
type: core
group: models

traces:
type: core
group: models


clusters:
config:
color: "#20BF55"

assertion_engine:
color: "#0B4F6C"

test_runner:
color: "#976391"

startup:
color: "#293F14"

0 comments on commit 87332a7

Please sign in to comment.