-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (80 loc) · 2.87 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: CI
on:
pull_request: ~
push:
branches: [main] # so that we build a Go cache that can be re-used in PRs
jobs:
linters:
name: Linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
- name: Run golangci-lint
run: make lint
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
- name: Tests
run: make tests
registry:
name: Generate registry
runs-on: ubuntu-latest
strategy:
matrix:
kind_version: [next, v11.2.x, v11.1.x, v11.0.x, v10.4.x, v10.3.x, v10.2.x, v10.1.x]
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
- name: Clone kind-registry
run: git clone --depth=1 https://github.com/grafana/kind-registry.git ../kind-registry
- name: Run code generation
run: |
devbox run go run cmd/cli/main.go generate \
--config ./config/foundation_sdk.dev.yaml \
--parameters output_dir=./generated/%l,grafana_version=${{ matrix.kind_version == 'next' && 'main' || matrix.kind_version }},kind_registry_version=${{ matrix.kind_version }},go_package_root=github.com/grafana/cog/generated/go
- name: Compile generated Go code
run: devbox run ./scripts/ci/build-go.sh
- name: Compile generated Typescript code
run: devbox run ./scripts/ci/build-ts.sh
- name: Lint generated Python code
run: devbox run mypy generated/python/
- name: Compile generated Java code
run: devbox run gradle build -p generated/java
- name: Lint generated PHP code with phpstan
run: devbox run phpstan analyze --memory-limit 256M -c .config/ci/php/phpstan.neon
- name: Lint generated PHP code with psalm
run: devbox run psalm -c .config/ci/php/psalm.xml generated/php
examples:
name: Run examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
- name: Clone kind-registry
run: git clone --depth=1 https://github.com/grafana/kind-registry.git ../kind-registry
- name: Run code generation
run: make gen-sdk-dev
- name: Run the Go example
run: make run-go-example
- name: Run the Typescript example
run: make run-ts-example
- name: Run the PHP example
run: make run-php-example
- name: Run Java example
run: make run-java-example