-
Notifications
You must be signed in to change notification settings - Fork 6
117 lines (95 loc) · 2.94 KB
/
pr_build.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: DotNet Instrumentation PR Build
on:
pull_request:
branches:
- main
- "release/v*"
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Build on Linux
if: runner.os == 'Linux'
run: bash build.sh
- name: Build on Windows
if: runner.os == 'Windows'
run: .\build.cmd
- name: Build on macOS
if: runner.os == 'macOS'
run: bash build.sh
- name: Test on Linux
if: runner.os == 'Linux'
run: dotnet test
- name: Test on Windows
if: runner.os == 'Windows'
run: dotnet test
- name: Test on macOS
if: runner.os == 'macOS'
run: dotnet test
build-arm:
runs-on: codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Build on Linux
run: bash build.sh
- name: Test on Linux
run: dotnet test
build-x64-musl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/alpine.dockerfile" ./docker
docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && dotnet test && ./build.sh'
build-arm-musl:
runs-on: codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/alpine.dockerfile" ./docker
docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && dotnet test && ./build.sh'
contract-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up and run contract tests with pytest
run: |
cd test
bash ./build-and-install-distro.sh
bash ./set-up-contract-tests.sh
pytest contract-tests/tests