(chore) Added Test Workflow, updated Makefile #1
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: Test prom-exporter | |
on: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@master | |
with: | |
go-version: 1.21.x | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build image | |
id: build | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
load: true | |
tags: prom-exporter:test | |
- name: Test Execution | |
run: | | |
timeout 10s docker run --rm prom-exporter:test \ | |
-listen-address ":9201" \ | |
-service-name "test" -service-uri "test" -service-port "5066" -service-metrics-path "stats" || code=$? | |
if [[ $code -ne 124 ]]; then | |
echo "Exporter stopped with ${code}. It was expected to run forever." | |
exit 1; | |
fi |