Merge pull request #25 from uta8a/renovate/all-dependencies #72
This file contains hidden or 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: Prometheus Starter CI | |
| on: | |
| push: | |
| paths: | |
| - 'prometheus-starter/**' | |
| - '.github/workflows/prometheus-starter.yml' | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - 'prometheus-starter/**' | |
| - '.github/workflows/prometheus-starter.yml' | |
| jobs: | |
| test-app: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3 | |
| - name: Test | |
| run: | | |
| cd prometheus-starter/app | |
| go test -v ./... | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Start services | |
| run: | | |
| cd prometheus-starter | |
| docker compose up -d | |
| - name: Wait for services to be ready | |
| run: | | |
| echo "Waiting for app..." | |
| for i in {1..20}; do | |
| curl -s http://localhost:8080/metrics && echo "App is ready" && break || (echo "Waiting..." && sleep 5) | |
| done | |
| echo "Waiting for Prometheus..." | |
| for i in {1..20}; do | |
| curl -s http://localhost:9090/-/healthy && echo "Prometheus is ready" && break || (echo "Waiting..." && sleep 5) | |
| done | |
| echo "Waiting for Grafana..." | |
| for i in {1..20}; do | |
| curl -s http://localhost:3000/api/health && echo "Grafana is ready" && break || (echo "Waiting..." && sleep 5) | |
| done | |
| - name: Check Connectivity | |
| run: | | |
| echo "Checking app health..." | |
| curl -f http://localhost:8080/ || exit 1 | |
| echo "Checking Prometheus health..." | |
| curl -f http://localhost:9090/-/healthy || exit 1 | |
| echo "Checking Grafana health..." | |
| curl -f http://localhost:3000/api/health || exit 1 | |
| - name: Stop services | |
| if: always() | |
| run: | | |
| cd prometheus-starter | |
| docker compose down |