65 lines
No EOL
2.1 KiB
YAML
65 lines
No EOL
2.1 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: Test WaylonWalker.com
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
# events but only for the master branch
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@main
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.8' # Version range or exact version of a Python version to use, using SemVer's version range syntax
|
|
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
|
- run: pip install -r requirements.txt
|
|
- name: Run TestProject Agent
|
|
env:
|
|
TP_API_KEY: ${{ secrets.TP_API_KEY }}
|
|
run: |
|
|
envsubst < .github/ci/docker-compose.yml > docker-compose.yml
|
|
docker-compose -f docker-compose.yml up -d
|
|
- name: Wait for Agent to Register
|
|
run: |
|
|
trap 'kill $(jobs -p)' EXIT
|
|
attempt_counter=0
|
|
max_attempts=100
|
|
mkdir -p build/reports/agent
|
|
docker-compose -f docker-compose.yml logs -f | tee build/reports/agent/log.txt&
|
|
until curl -s http://localhost:8585/api/status | jq '.registered' | grep true; do
|
|
if [ ${attempt_counter} -eq ${max_attempts} ]; then
|
|
echo "Agent failed to register. Terminating..."
|
|
exit 1
|
|
fi
|
|
attempt_counter=$(($attempt_counter+1))
|
|
echo
|
|
echo
|
|
echo ----------------------------------
|
|
date
|
|
echo attempt $attempt_counter
|
|
echo status
|
|
curl -s http://localhost:8585/api/status
|
|
echo
|
|
echo home
|
|
curl -s http://localhost:8585/
|
|
|
|
sleep 1
|
|
done
|
|
- run: pytest > pytest.log
|
|
env:
|
|
TP_DEV_TOKEN: ${{ secrets.TP_DEV_TOKEN }}
|
|
|
|
- name: Archive code coverage results
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: pytest-log
|
|
path: pytest.log |