Skip to content

Commit bbeb060

Browse files
committed
feat: test background action
1 parent bc9dfd6 commit bbeb060

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

.github/workflows/postman.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,35 @@ jobs:
5757
npm install
5858
cp .env.sample .env
5959
RUNNER_TRACKING_ID="" && npm run dev > $GITHUB_WORKSPACE/api.log 2>&1 &
60-
- name: Wait for api
61-
run: |
62-
echo "Waiting for API to be ready..."
63-
while ! curl -s -f -o /dev/null http://localhost:8080/v2/builds; do
64-
sleep 10
65-
done
66-
echo "API is ready!"
60+
- uses: JarvusInnovations/background-action@v1
61+
name: Bootstrap System Under Test (SUT)
62+
with:
63+
run: |
64+
npm run dev
65+
# your step-level and job-level environment variables are available to your commands as-is
66+
# npm install will count towards the wait-for timeout
67+
# whenever possible, move unrelated scripts to a different step
68+
# to background multiple processes: add & to the end of the command
69+
70+
wait-on: |
71+
http://localhost:8080/v2/builds
72+
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
73+
# See wait-on section below for all resource types and prefixes
74+
75+
tail: true # true = stderr,stdout
76+
# This will allow you to monitor the progress live
77+
78+
wait-for: 5m
79+
80+
log-output-if: failure
81+
# failure = exit-early or timeout
82+
# - name: Wait for api
83+
# run: |
84+
# echo "Waiting for API to be ready..."
85+
# while ! curl -s -f -o /dev/null http://localhost:8080/v2/builds; do
86+
# sleep 10
87+
# done
88+
# echo "API is ready!"
6789
- name: Install Postman CLI
6890
run: |
6991
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh

0 commit comments

Comments
 (0)