Hardcode nip.io test hosts to /etc/hosts (#39044)

Closes #38104

Signed-off-by: Václav Muzikář <vmuzikar@redhat.com>
This commit is contained in:
Václav Muzikář
2025-04-24 08:56:03 +02:00
committed by GitHub
parent efcd6aaaac
commit 8885a6276c
5 changed files with 28 additions and 2 deletions

View File

@@ -14,6 +14,10 @@ inputs:
runs:
using: composite
steps:
- id: update-hosts
name: Update /etc/hosts
uses: ./.github/actions/update-hosts
- id: setup-java
name: Setup Java
uses: ./.github/actions/java-setup

21
.github/actions/update-hosts/action.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Update /etc/hosts
description: Update /etc/hosts file to hardcode known nip.io hostnames. This is to avoid test instability due to DNS resolution issues.
runs:
using: composite
steps:
- id: update-hosts-linux
name: Update /etc/hosts
if: runner.os == 'Linux'
shell: bash
run: |
printf "\n\n$(cat .github/actions/update-hosts/nipio-hosts)" | sudo tee -a /etc/hosts
- id: update-hosts-windows
name: Update C:\Windows\System32\drivers\etc\hosts
if: runner.os == 'Windows'
shell: powershell
run: |
"`n`n" | Add-Content C:\Windows\System32\drivers\etc\hosts
Get-Content .github/actions/update-hosts/nipio-hosts | Add-Content C:\Windows\System32\drivers\etc\hosts

View File

@@ -0,0 +1 @@
127.0.0.1 127.0.0.1.nip.io admin.127.0.0.1.nip.io localhost-myapp.127.0.0.1.nip.io localhost-sso.127.0.0.1.nip.io realmFrontend.127.0.0.1.nip.io proxy.kc.127.0.0.1.nip.io