Skip to content

Merge pull request #6 from BreathXV:go #7

Merge pull request #6 from BreathXV:go

Merge pull request #6 from BreathXV:go #7

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test-api-endpoint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22.3
- name: Install dependencies
run: go mod tidy
- name: Build and run the application
run: |
docker build -t rwapi .
docker run -e "DATABASE_PATH=:memory:" -p 8080:8080 rwapi
- name: Test endpoint /check-whitelist
run: |
response=$(curl -s -X POST http://localhost:8080/check-whitelist -H "Content-Type: application/json" -d '{"ServerID": "1cdfa108-0ba6-45fc-9756-22e76304e8fa", "IdentityID": "465c3a56-743b-4755-bad0-2c60c625a779"}')
echo "$response" | jq .
echo "$response" | jq -e '.whitelisted == "true"' > /dev/null