mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-06-27 16:35:58 +00:00
ci: Fix forgotton environment variables
This commit is contained in:
parent
a7e0a07f4f
commit
744a97e28f
1 changed files with 9 additions and 29 deletions
38
.github/workflows/windows-tests.yml
vendored
38
.github/workflows/windows-tests.yml
vendored
|
@ -49,41 +49,21 @@ jobs:
|
|||
mkdir -p /run/openrc
|
||||
touch /run/openrc/softlevel
|
||||
|
||||
# Check if Docker is already in the default runlevel before adding it
|
||||
if ! rc-status default | grep -q "docker"; then
|
||||
rc-update add docker default || true
|
||||
fi
|
||||
# Add Docker to the default runlevel and start it
|
||||
rc-update add docker default
|
||||
rc-service docker start
|
||||
|
||||
# Check Docker service status
|
||||
docker_status=$(rc-service docker status 2>&1 || echo "not running")
|
||||
|
||||
# Start Docker only if it's not already running or starting
|
||||
if echo "$docker_status" | grep -q "not running"; then
|
||||
echo "Starting Docker service..."
|
||||
rc-service docker start || true
|
||||
else
|
||||
echo "Docker service status: $docker_status"
|
||||
fi
|
||||
|
||||
# Wait for Docker to be ready regardless of how it was started
|
||||
# Wait for Docker to be ready
|
||||
echo "Waiting for Docker to be ready..."
|
||||
timeout=60
|
||||
for i in $(seq 1 $timeout); do
|
||||
for i in {1..30}; do
|
||||
if docker info > /dev/null 2>&1; then
|
||||
echo "Docker is ready!"
|
||||
break
|
||||
fi
|
||||
echo "Waiting for Docker to be ready... ($i/$timeout)"
|
||||
echo "Waiting for Docker to be ready... ($i/30)"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Final check to ensure Docker is working
|
||||
if ! docker info > /dev/null 2>&1; then
|
||||
echo "Docker is still not ready after waiting. Showing service status:"
|
||||
rc-service docker status || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: WSL - Start Forgejo Server
|
||||
shell: wsl-bash {0}
|
||||
run: |
|
||||
|
@ -160,6 +140,6 @@ jobs:
|
|||
- name: Windows - Run tests
|
||||
run: go test -v ./...
|
||||
env:
|
||||
FORGEJO_URL: http://localhost:3000
|
||||
FORGEJO_RUNNER_SECRET: ${{ env.RUNNER_TOKEN }}
|
||||
FORGEJO_RUNNER_HEX_SECRET: ${{ env.RUNNER_HEX_TOKEN }}
|
||||
FORGEJO_URL: ${{ env.FORGEJO_ROOT_URL }}
|
||||
FORGEJO_RUNNER_SECRET: ${{ env.FORGEJO_RUNNER_SECRET }}
|
||||
FORGEJO_RUNNER_HEX_SECRET: ${{ env.FORGEJO_RUNNER_SECRET }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue