-
Notifications
You must be signed in to change notification settings - Fork 13
140 lines (122 loc) · 5.27 KB
/
ci.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Confirm tests run successfully
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Verify tests pass
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
container_image:
- docker.io/library/alpine:latest
- docker.io/library/alpine:edge
- quay.io/centos/centos:stream9
- quay.io/centos/centos:stream10-development
- registry.fedoraproject.org/fedora:39
- registry.fedoraproject.org/fedora:40
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
- registry.access.redhat.com/ubi9
dotnet_version:
- "6.0"
- "8.0"
exclude:
- container_image: registry.fedoraproject.org/fedora:rawhide
dotnet_version: "6.0"
- container_image: quay.io/centos/centos:stream10-development
dotnet_version: "6.0"
include:
- container_image: registry.fedoraproject.org/fedora:40
dotnet_version: "9.0"
- container_image: registry.fedoraproject.org/fedora:rawhide
dotnet_version: "9.0"
- container_image: quay.io/centos/centos:stream10-development
dotnet_version: "9.0"
container:
image: ${{ matrix.container_image }}
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v4
- name: Install .NET ${{ matrix.dotnet_version }}
timeout-minutes: 10
run: |
set -euo pipefail
cat /etc/os-release
# .NET 9 is currently a preview, copr is needed to install it.
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
dnf install 'dnf-command(copr)' -y
if grep centos /etc/os-release; then
dnf copr enable @dotnet-sig/dotnet-preview centos-stream-10-x86_64 -y
else
dnf copr enable @dotnet-sig/dotnet-preview -y
fi
# The package 'dotnet-sdk-aot' was introduced in .NET 9.
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
fi
# '/etc/os-release' will also match the 'grep fedora' on Fedora derived systems, such as CentOS.
if grep fedora /etc/os-release; then
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }}
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
dnf install -y \
# The 'dbg' packages were introduced in .NET 8.
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
elif grep alpine /etc/os-release; then
if grep edge /etc/os-release; then
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
fi
apk add dotnet-sdk-${{ matrix.dotnet_version }} dotnet-doc
if [[ ! ${{ matrix.dotnet_version }} == *6* ]]; then
apk add \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
fi
fi
- name: Install Test dependencies
timeout-minutes: 5
run: |
if grep fedora /etc/os-release ; then
dnf install -y python3 wget $(grep '^Dependencies(dnf): ' README.md | cut -d: -f2-) --skip-broken
elif grep alpine /etc/os-release; then
apk add python3 wget curl $(grep '^Dependencies(apk): ' README.md | cut -d: -f2-)
echo -e '[PostgreSQL]\nDescription=PostgreSQL Unicode\nDriver=/usr/lib/psqlodbcw.so\nUsageCount=1' > /etc/odbcinst.ini
fi
- name: Download test runner
run: |
set -euo pipefail
wget --no-verbose https://github.com/redhat-developer/dotnet-bunny/releases/latest/download/turkey.tar.gz
tar xf turkey.tar.gz
- name: Run tests
run: |
set -euo pipefail
### This is very questionable, but making our CI fail because distro
### .NET versions are out of date doesn't sound nice.
rm -rf release-version-sane
### HACK: Filter tests that can't pass in Containers
rm -rf debugging-sos-lldb* createdump-aspnet cgroup-limit
### HACK: RID parsing is broken on alpine:edge, so these tests fail
if [[ ${{ matrix.container_image }} == *'alpine:edge'* ]] ; then
rm -rf system-data-odbc
fi
### HACK: UBI 8 is missing bash-completion, postgres, and strace packages for tests
if [[ ${{ matrix.container_image }} == *ubi8* ]] ; then
rm -rf bash-completion system-data-odbc telemetry-is-off-by-default
fi
### HACK: UBI 9 is missing postsgres and strace package for tests
if [[ ${{ matrix.container_image }} == *ubi9* ]] ; then
rm -rf system-data-odbc telemetry-is-off-by-default
fi
dotnet turkey/Turkey.dll -v --timeout 600
- name: Show Logs
if: ${{ always() }}
run: |
set -euo pipefail
find -iname '*.log' -exec echo {} \; -exec cat {} \;