Skip to content

Fix ci, rfs #273

Fix ci, rfs #273 #5

Workflow file for this run

name: Test Container
on:
push:
pull_request:
branches:
- master
schedule:
# Every sunday at 8:05 UTC
- cron: "5 8 * * 0"
# If you trigger a new workflow while the previous one is running,
# this will cancel the previous one.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Spin up container
run: |
sed -i 's/PYTHON_VERSION=.*/PYTHON_VERSION=311/' '.env'
sed -i 's/PORT=.*/PORT=5003/' '.env'
echo "Building container for Python $PYTHON_VERSION."
docker compose up -d
- name: Wait and check the health of the container
run: |
attempts=0
while [ $attempts -lt 5 ]; do
if curl http://localhost:5002; then
echo "Success!"
exit 0
fi
attempts=$((attempts+1))
sleep 1
done
echo "Failed after $attempts attempts"
exit 1