-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (81 loc) · 2.97 KB
/
Copy pathci.yml
File metadata and controls
96 lines (81 loc) · 2.97 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props') }}
restore-keys: nuget-${{ runner.os }}-
- name: Restore
run: dotnet restore
# Warnings are errors and code style is enforced at build time, so this doubles as the
# lint step. There is no separate formatting job to drift out of sync with it.
- name: Build
run: dotnet build --configuration Release --no-restore
# The evaluation suite starts a real PostgreSQL with pgvector through Testcontainers, using
# the Docker daemon that ships on the runner. Embeddings use the deterministic provider, so
# nothing here needs a model provider or costs anything to run.
#
# The live-model tier is excluded explicitly rather than left to skip itself: a runner that
# happened to reach an Ollama server would otherwise pull a multi-gigabyte model and add
# minutes of inference to every build.
- name: Test
run: >
dotnet test
--configuration Release
--no-build
--filter "Category!=LiveModel"
--logger "trx;LogFileName=test-results.trx"
--logger "console;verbosity=normal"
--results-directory ${{ github.workspace }}/artifacts/test-results
--collect:"XPlat Code Coverage"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: artifacts/test-results
retention-days: 14
docker-build:
name: Build container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
# Built but not pushed: this proves the Dockerfile still works from a clean checkout
# without the repository needing a registry or credentials.
- name: Build API image
uses: docker/build-push-action@v6
with:
context: .
file: src/OperationsCopilot.Api/Dockerfile
push: false
load: true
tags: operations-copilot-api:ci
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Verify the image starts
run: |
docker run --rm --entrypoint dotnet operations-copilot-api:ci \
OperationsCopilot.Api.dll --version || true
docker image inspect operations-copilot-api:ci --format 'Image size: {{.Size}} bytes'