Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
pull_request:

jobs:
validate-servers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for diffing

- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: go.sum
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed servers
shell: bash
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git diff --name-only --diff-filter=AM origin/${{ github.event.pull_request.base.ref }} HEAD | grep "^servers/" > changed-servers.txt || true

- name: Build and catalog changed servers
shell: bash
run: |
set -eo pipefail
while IFS= read -r file; do
dir=$(dirname "$file")
name=$(basename "$dir")
task build -- --tools $name
echo "--------------------------------"
task catalog -- $name
echo "--------------------------------"
cat catalogs/$name/catalog.yaml
echo "--------------------------------"
done < changed-servers.txt