I would like to serve local files through a web-server and execute some tests inside GitHub Action that runs Windows, but I cannot make it run server in the background
Here's my setup:
name: CI Windows
on:
push:
branches:
- '*'
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Test local api
run: |
cmd /c "START /b run-local-api-server.bat"
curl -X GET "http://localhost:9195/README.md"
And run-local-api-server.bat script:
@echo off
python3 -m http.server 9195
The error I get is curl: (7) Failed to connect to localhost port 9195: Connection refused.
Links:
Check first if adding a small pause would help.
And check the expected port is listening.
- name: Test local api
run: |
cmd /c "START /b run-local-api-server.bat"
ping 127.0.0.1 -n 6 > nul
netstat -o -n -a | findstr 9195
curl -X GET "http://localhost:9195/README.md"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With