Skip to content

reconcile docker containers. add noaa token to int test #4

reconcile docker containers. add noaa token to int test

reconcile docker containers. add noaa token to int test #4

name: integration-test
on:
push:
jobs:
docker-build-and-test:
name: Build Docker and Test Server
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
NOAA_TOKEN: ${{ secrets.NOAA_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Docker
uses: docker/setup-buildx-action@v2
- name: Build Docker Image
run: |
docker build -t bsyncr-server .
- name: Run Docker Container
run: |
docker run -p 8080:5000 -e NOAA_TOKEN bsyncr-server
echo "Docker container started successfully"
- name: Extra wait
run: |
sleep 10
- name: Health check
run: |
curl -f http://localhost:8080/health || exit 1
- name: Post BuildingSync file
run: |
curl -X POST "http://localhost:8080/?model_type=SLR" \
-F "file=@tests/data/ex_bsync.xml" \
--max-time 120 \
--output ./tests/slr_results.zip
# check if the slr_results.zip file exists, error if not
if [ ! -f ./tests/slr_results.zip ]; then
echo "Error: slr_results.zip not found!"
exit 1
fi
echo "slr_results.zip file exists, proceeding with next steps."
- name: Cleanup Docker Container
run: |
docker stop bsyncr-server
docker rm bsyncr-server