|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - pull_request: |
8 | | - types: |
9 | | - - opened |
10 | | - - reopened |
11 | | - - synchronize |
12 | | - merge_group: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + types: |
| 9 | + - opened |
| 10 | + - reopened |
| 11 | + - synchronize |
| 12 | + merge_group: |
13 | 13 |
|
14 | 14 | permissions: |
15 | | - contents: read |
16 | | - pull-requests: read |
| 15 | + contents: read |
17 | 16 |
|
18 | 17 | jobs: |
19 | | - # --------------------------------------------------------------------------- |
20 | | - # BUILD AND UNIT TESTS (special case - Gazelle + build + unit tests) |
21 | | - # --------------------------------------------------------------------------- |
22 | | - build-and-unit-test: |
23 | | - name: Build and Unit Test |
24 | | - runs-on: ubuntu-latest |
25 | | - steps: |
26 | | - - uses: actions/checkout@v4 |
27 | | - - uses: ./.github/actions/setup |
28 | | - |
29 | | - - name: Check BUILD files are up to date |
30 | | - run: | |
31 | | - echo "Running Gazelle to check BUILD files..." >&2 |
32 | | - make gazelle |
33 | | - if ! git diff --quiet; then |
34 | | - echo "BUILD files are out of date!" >&2 |
35 | | - echo "" >&2 |
36 | | - echo "The following files were modified by Gazelle:" >&2 |
37 | | - git diff --name-only >&2 |
38 | | - echo "" >&2 |
39 | | - echo "Please run 'make gazelle' locally and commit the changes." >&2 |
40 | | - exit 1 |
41 | | - fi |
42 | | - echo "BUILD files are up to date" >&2 |
43 | | -
|
44 | | - - name: Build project |
45 | | - run: make build |
46 | | - |
47 | | - - name: Run unit tests |
48 | | - run: make test || echo "No unit tests found" |
49 | | - |
50 | | - # --------------------------------------------------------------------------- |
51 | | - # INTEGRATION TESTS (e2e, gateway, orchestrator) |
52 | | - # --------------------------------------------------------------------------- |
53 | | - e2e: |
54 | | - name: E2E Integration Test |
55 | | - runs-on: ubuntu-latest |
56 | | - steps: |
57 | | - - uses: actions/checkout@v4 |
58 | | - - uses: ./.github/actions/setup |
59 | | - |
60 | | - - name: Run E2E tests |
61 | | - run: make e2e-test |
62 | | - |
63 | | - gateway-integration-test: |
64 | | - name: Gateway Integration Test |
65 | | - runs-on: ubuntu-latest |
66 | | - steps: |
67 | | - - uses: actions/checkout@v4 |
68 | | - - uses: ./.github/actions/setup |
69 | | - |
70 | | - - name: Run Gateway integration tests |
71 | | - run: make integration-test-gateway |
72 | | - |
73 | | - orchestrator-integration-test: |
74 | | - name: Orchestrator Integration Test |
75 | | - runs-on: ubuntu-latest |
76 | | - steps: |
77 | | - - uses: actions/checkout@v4 |
78 | | - - uses: ./.github/actions/setup |
79 | | - |
80 | | - - name: Run Orchestrator integration tests |
81 | | - run: make integration-test-orchestrator |
82 | | - |
83 | | - # --------------------------------------------------------------------------- |
84 | | - # EXTENSION TESTS |
85 | | - # --------------------------------------------------------------------------- |
86 | | - counter-integration-test: |
87 | | - name: Counter Extension Test |
88 | | - runs-on: ubuntu-latest |
89 | | - steps: |
90 | | - - uses: actions/checkout@v4 |
91 | | - - uses: ./.github/actions/setup |
92 | | - - uses: ./.github/actions/run-bazel-test |
93 | | - with: |
94 | | - target: //test/integration/extension/counter/... |
95 | | - |
96 | | - queue-integration-test: |
97 | | - name: Queue Extension Test |
98 | | - runs-on: ubuntu-latest |
99 | | - steps: |
100 | | - - uses: actions/checkout@v4 |
101 | | - - uses: ./.github/actions/setup |
102 | | - - uses: ./.github/actions/run-bazel-test |
103 | | - with: |
104 | | - target: //test/integration/extension/queue/... |
105 | | - |
106 | | - storage-integration-test: |
107 | | - name: Storage Extension Test |
108 | | - runs-on: ubuntu-latest |
109 | | - steps: |
110 | | - - uses: actions/checkout@v4 |
111 | | - - uses: ./.github/actions/setup |
112 | | - - uses: ./.github/actions/run-bazel-test |
113 | | - with: |
114 | | - target: //test/integration/extension/storage/... |
115 | | - |
116 | | - # --------------------------------------------------------------------------- |
117 | | - # REQUIRED CHECKS GATE |
118 | | - # --------------------------------------------------------------------------- |
119 | | - required-checks: |
120 | | - name: Required Checks |
121 | | - runs-on: ubuntu-latest |
122 | | - needs: |
123 | | - - build-and-unit-test |
124 | | - - e2e |
125 | | - - gateway-integration-test |
126 | | - - orchestrator-integration-test |
127 | | - - counter-integration-test |
128 | | - - queue-integration-test |
129 | | - - storage-integration-test |
130 | | - steps: |
131 | | - - name: All required checks passed |
132 | | - run: | |
133 | | - echo "All required checks passed!" >&2 |
| 18 | + # --------------------------------------------------------------------------- |
| 19 | + # LINT (gofmt via Go SDK, yamlfmt via go run) |
| 20 | + # --------------------------------------------------------------------------- |
| 21 | + lint: |
| 22 | + name: Lint |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: ./.github/actions/setup |
| 27 | + |
| 28 | + - name: Run linters |
| 29 | + run: make lint |
| 30 | + |
| 31 | + # --------------------------------------------------------------------------- |
| 32 | + # TIDY (module files + BUILD files in sync) |
| 33 | + # --------------------------------------------------------------------------- |
| 34 | + tidy: |
| 35 | + name: Tidy |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - uses: ./.github/actions/setup |
| 40 | + |
| 41 | + - name: Check module files are tidy |
| 42 | + run: make check-tidy |
| 43 | + |
| 44 | + - name: Check BUILD files are up to date |
| 45 | + run: make check-gazelle |
| 46 | + |
| 47 | + # --------------------------------------------------------------------------- |
| 48 | + # BUILD AND UNIT TESTS |
| 49 | + # --------------------------------------------------------------------------- |
| 50 | + build-and-unit-test: |
| 51 | + name: Build and Unit Test |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - uses: ./.github/actions/setup |
| 56 | + |
| 57 | + - name: Build project |
| 58 | + run: make build |
| 59 | + |
| 60 | + - name: Run unit tests |
| 61 | + run: make test |
| 62 | + |
| 63 | + # --------------------------------------------------------------------------- |
| 64 | + # INTEGRATION TESTS (e2e, gateway, orchestrator) |
| 65 | + # --------------------------------------------------------------------------- |
| 66 | + e2e: |
| 67 | + name: E2E Integration Test |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - uses: ./.github/actions/setup |
| 72 | + |
| 73 | + - name: Run E2E tests |
| 74 | + run: make e2e-test |
| 75 | + |
| 76 | + gateway-integration-test: |
| 77 | + name: Gateway Integration Test |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v4 |
| 81 | + - uses: ./.github/actions/setup |
| 82 | + |
| 83 | + - name: Run Gateway integration tests |
| 84 | + run: make integration-test-gateway |
| 85 | + |
| 86 | + orchestrator-integration-test: |
| 87 | + name: Orchestrator Integration Test |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + - uses: ./.github/actions/setup |
| 92 | + |
| 93 | + - name: Run Orchestrator integration tests |
| 94 | + run: make integration-test-orchestrator |
| 95 | + |
| 96 | + # --------------------------------------------------------------------------- |
| 97 | + # EXTENSION TESTS |
| 98 | + # --------------------------------------------------------------------------- |
| 99 | + counter-integration-test: |
| 100 | + name: Counter Extension Test |
| 101 | + runs-on: ubuntu-latest |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@v4 |
| 104 | + - uses: ./.github/actions/setup |
| 105 | + - uses: ./.github/actions/run-bazel-test |
| 106 | + with: |
| 107 | + target: //test/integration/extension/counter/... |
| 108 | + |
| 109 | + queue-integration-test: |
| 110 | + name: Queue Extension Test |
| 111 | + runs-on: ubuntu-latest |
| 112 | + steps: |
| 113 | + - uses: actions/checkout@v4 |
| 114 | + - uses: ./.github/actions/setup |
| 115 | + - uses: ./.github/actions/run-bazel-test |
| 116 | + with: |
| 117 | + target: //test/integration/extension/queue/... |
| 118 | + |
| 119 | + storage-integration-test: |
| 120 | + name: Storage Extension Test |
| 121 | + runs-on: ubuntu-latest |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v4 |
| 124 | + - uses: ./.github/actions/setup |
| 125 | + - uses: ./.github/actions/run-bazel-test |
| 126 | + with: |
| 127 | + target: //test/integration/extension/storage/... |
| 128 | + |
| 129 | + # --------------------------------------------------------------------------- |
| 130 | + # REQUIRED CHECKS GATE |
| 131 | + # --------------------------------------------------------------------------- |
| 132 | + required-checks: |
| 133 | + name: Required Checks |
| 134 | + runs-on: ubuntu-latest |
| 135 | + needs: |
| 136 | + - lint |
| 137 | + - tidy |
| 138 | + - build-and-unit-test |
| 139 | + - e2e |
| 140 | + - gateway-integration-test |
| 141 | + - orchestrator-integration-test |
| 142 | + - counter-integration-test |
| 143 | + - queue-integration-test |
| 144 | + - storage-integration-test |
| 145 | + steps: |
| 146 | + - name: All required checks passed |
| 147 | + run: | |
| 148 | + echo "All required checks passed!" >&2 |
0 commit comments