set tests to run in bash strict mode #480
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-development | |
- registry.fedoraproject.org/fedora:37 | |
- registry.fedoraproject.org/fedora:38 | |
- registry.fedoraproject.org/fedora:rawhide | |
- registry.access.redhat.com/ubi8 | |
- registry.access.redhat.com/ubi9 | |
dotnet_version: | |
- "6.0" | |
- "7.0" | |
include: | |
- container_image: registry.fedoraproject.org/fedora:38 | |
dotnet_version: "8.0" | |
- container_image: registry.access.redhat.com/ubi8 | |
dotnet_version: "8.0" | |
container: | |
image: ${{ matrix.container_image }} | |
options: --security-opt seccomp=unconfined | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET ${{ matrix.dotnet_version }} | |
timeout-minutes: 5 | |
run: | | |
set -euo pipefail | |
cat /etc/os-release | |
if [[ ${{ matrix.dotnet_version }} == "8.0" ]]; then | |
dnf install -y dnf-plugins-core | |
if [[ ${{ matrix.container_image }} == *ubi8* ]] ; then | |
dnf copr enable -y @dotnet-sig/dotnet-preview rhel-8-$(uname -m) | |
else | |
dnf copr enable -y @dotnet-sig/dotnet-preview | |
fi | |
fi | |
if grep fedora /etc/os-release ; then | |
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} | |
elif grep alpine /etc/os-release; then | |
apk add dotnet-sdk-${{ matrix.dotnet_version }} dotnet-doc | |
fi | |
- name: Install Test dependencies | |
timeout-minutes: 2 | |
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 $(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 {} \; |