phattt2901 580c0deff3
Some checks failed
Go CI Pipeline / Lint Code (push) Failing after 16s
Go CI Pipeline / Security Scan (SCA) (push) Failing after 1m3s
DNS & Network Test / network-test (push) Failing after 3s
Go CI Pipeline / Run Tests (push) Successful in 52s
Go CI Pipeline / Build Application (push) Has been skipped
Test CI v2.1.29
2025-05-04 12:48:48 +07:00

33 lines
1.3 KiB
YAML

name: DNS & Network Test
on:
push:
branches: [master]
jobs:
network-test:
runs-on: ubuntu-latest # GITEA_RUNNER_LABELS cần map tới: docker://ubuntu:20.04
container:
image: nikolaik/golang-nodejs:1.22-20
options: --network gitea_gitea_network
steps:
- name: Add host IP alias
run: |
echo "172.17.0.1 server" >> /etc/hosts
echo "Added host IP alias"
- name: Cập nhật và cài curl + dnsutils
run: |
apt update
apt install -y curl iputils-ping
echo "Updated and installed curl, iputils-ping"
- name: Kiểm tra kết nối curl
run: |
echo "🧪 Đang kiểm tra HTTP..."
curl -v -f --connect-timeout 10 http://server:3000 || echo "[ERROR] Curl to http://server:3000 failed"
curl -v -f --connect-timeout 10 http://gitea_server:3000 || echo "[ERROR] Curl to http://gitea_server:3000 failed"
curl -v -f --connect-timeout 10 http://172.17.0.1:3000 || echo "[ERROR] Curl to http://172.17.0.1:3000 failed"
curl -v -f --connect-timeout 10 https://gitea.tuvanwebsite.com || echo "[ERROR] Curl to https://gitea.tuvanwebsite.com failed"
curl -I https://google.com
curl -I https://github.com