Skip to content

test: wire test/framework packages into unit tests and coverage #16

test: wire test/framework packages into unit tests and coverage

test: wire test/framework packages into unit tests and coverage #16

name: CI - Coordinator Test
# Runs coordinator unit tests and e2e tests. Path filter excludes paths not
# exercised by the coordinator.
on:
push:
branches:
- main
- 'release-*'
pull_request:
branches:
- main
permissions:
contents: read
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout source
uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
src:
- '**/*.go'
- Dockerfile.*
- Makefile*
- go.mod
- go.sum
- scripts/**
- hack/**
- test/**
- .github/actions/e2e-runner-setup/action.yml
- .github/workflows/ci-coordinator.yaml
- '!Dockerfile.sidecar'
- '!cmd/pd-sidecar/**'
- '!pkg/sidecar/**'
- '!test/sidecar/**'
- '!pkg/generator/**'
- '!test/e2e/**'
- '!test/integration/**'
- '!test/profiling/**'
- '!Makefile'
unit-tests:
needs: check-changes
if: ${{ needs.check-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Create Go cache dirs
id: go-cache
run: |
mkdir -p "$HOME/.cache/llm-d-gomodcache" "$HOME/.cache/llm-d-gobuildcache"
echo "mod=$HOME/.cache/llm-d-gomodcache" >> "$GITHUB_OUTPUT"
echo "build=$HOME/.cache/llm-d-gobuildcache" >> "$GITHUB_OUTPUT"
- name: Cache Go modules and build cache
uses: actions/cache@v6
with:
path: |
${{ steps.go-cache.outputs.mod }}
${{ steps.go-cache.outputs.build }}
key: go-cache-${{ runner.os }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-cache-${{ runner.os }}-
- name: Run coordinator unit tests
shell: bash
env:
GO_MOD_CACHE_VOL: ${{ steps.go-cache.outputs.mod }}
GO_BUILD_CACHE_VOL: ${{ steps.go-cache.outputs.build }}
run: make -f Makefile.coord.mk test-unit
e2e-tests:
needs: check-changes
if: ${{ needs.check-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout source
uses: actions/checkout@v7
- name: Set up e2e runner
id: e2e-setup
uses: ./.github/actions/e2e-runner-setup
- name: Run coordinator e2e tests
shell: bash
env:
GO_MOD_CACHE_VOL: ${{ steps.e2e-setup.outputs.go-mod-cache }}
GO_BUILD_CACHE_VOL: ${{ steps.e2e-setup.outputs.go-build-cache }}
run: make -f Makefile.coord.mk test-e2e-coordinator