-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 1.81 KB
/
agent_pull_request.yml
File metadata and controls
78 lines (68 loc) · 1.81 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
name: Agent PR
on:
pull_request:
paths:
- src/agent/**
- src/common/dotnet/**
- src/protos/**
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
CI: true
jobs:
dotnet_build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/agent
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Restore tools
run: dotnet tool restore
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore --locked-mode
- name: Build solution
run: dotnet build --no-restore
- name: Run tests
run: dotnet test --no-build --verbosity normal --filter Category!=EndToEnd
docker_build:
runs-on: ubuntu-latest
env:
BASE_IMAGE: localhost:5000/safir/agent-base
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build base image
id: base-build
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:src"
file: ./common/dotnet/Dockerfile
push: true
tags: ${{ env.BASE_IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker build
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:src"
file: ./agent/Dockerfile
build-args: CommonImage=${{ env.BASE_IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max