Skip to content

Commit 9bd9585

Browse files
authored
Verify added and modified servers in CI (github#41)
* Verify added servers in CI. * Fix typo. * Cat the catalog for better visibility. * Add setup stuff. * Remove buildx.
1 parent 0556554 commit 9bd9585

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
pull_request:
3+
4+
jobs:
5+
validate-servers:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
with:
10+
fetch-depth: 0 # Needed for diffing
11+
12+
- name: Install Go
13+
uses: actions/setup-go@v5
14+
with:
15+
cache-dependency-path: go.sum
16+
go-version-file: go.mod
17+
18+
- name: Install Task
19+
uses: arduino/setup-task@v2
20+
with:
21+
version: 3.x
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Get changed servers
25+
shell: bash
26+
run: |
27+
git fetch origin ${{ github.event.pull_request.base.ref }}
28+
git diff --name-only --diff-filter=AM origin/${{ github.event.pull_request.base.ref }} HEAD | grep "^servers/" > changed-servers.txt || true
29+
30+
- name: Build and catalog changed servers
31+
shell: bash
32+
run: |
33+
set -eo pipefail
34+
while IFS= read -r file; do
35+
dir=$(dirname "$file")
36+
name=$(basename "$dir")
37+
task build -- --tools $name
38+
echo "--------------------------------"
39+
task catalog -- $name
40+
echo "--------------------------------"
41+
cat catalogs/$name/catalog.yaml
42+
echo "--------------------------------"
43+
done < changed-servers.txt

0 commit comments

Comments
 (0)