-
Notifications
You must be signed in to change notification settings - Fork 293
58 lines (47 loc) · 2.07 KB
/
ci-Exporter.OneCollector-Integration.yml
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
name: Integration Build OpenTelemetry.Exporter.OneCollector
permissions:
contents: read
on:
pull_request_target: # Allows secret access from forks see: https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks
branches: [ 'main*', 'exporter*' ]
paths:
- '*/OpenTelemetry.Exporter.OneCollector*/**'
- 'src/Shared/**'
- 'build/**'
- '!**.md'
env:
PROJECT: OpenTelemetry.Exporter.OneCollector
jobs:
authorize:
environment: # Run external PRs from forks on the "external"" environment which requires approval
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: echo ✓
build-integration-test:
needs: authorize
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }} # Run on the fork branch once approved
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: dotnet restore build/Projects/${{env.PROJECT}}.proj
run: dotnet restore build/Projects/${{env.PROJECT}}.proj
- name: dotnet build build/Projects/${{env.PROJECT}}.proj
run: dotnet build build/Projects/${{env.PROJECT}}.proj --configuration Release --no-restore
- name: dotnet test test/${{env.PROJECT}}.Tests
run: dotnet test test/${{env.PROJECT}}.Tests --filter CategoryName=OneCollectorIntegrationTests --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed"
env:
OTEL_ONECOLLECTOR_INSTRUMENTATION_KEY: ${{ secrets.OTEL_ONECOLLECTOR_INSTRUMENTATION_KEY }}