Skip to content

[test visibility] Total code coverage for vitest #32298

[test visibility] Total code coverage for vitest

[test visibility] Total code coverage for vitest #32298

Workflow file for this run

name: Preview Synthetics
on: [pull_request]
# Stop the current running job if a new push is made to the PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
synthetic_testing:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
path: repo
sparse-checkout: |
.
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${{ github.event.pull_request.head.ref }})" >>$GITHUB_OUTPUT
id: extract_branch
- name: Check preview status
id: check-status
run: |
URL="https://docs-staging.datadoghq.com/${{steps.extract_branch.outputs.branch}}"
SUCCESS_CODES=("200" "302" "304")
for i in {1..30}
do
status=$(curl -o /dev/null -s -w "%{http_code}\n" $URL)
if [[ " ${SUCCESS_CODES[@]} " =~ " ${status} " ]]; then
echo "Preview site has been deployed"
break
else
echo "Waiting for preview site to return 200 || 302 || 304..."
echo "Currently returning ${status}"
sleep 30
fi
if [[ $i -eq 30 && ! (" ${SUCCESS_CODES[@]} " =~ " ${status} ") ]]; then
echo "Preview site returned ${status} for 15 minutes, there may be an issue with the preview site build"
exit 1
fi
done
- name: Run Datadog Synthetic tests
uses: DataDog/synthetics-ci-github-action@v1.3.0
env:
CI_COMMIT_REF_NAME: ${{steps.extract_branch.outputs.branch}}
with:
api_key: ${{secrets.DD_API_KEY}}
app_key: ${{secrets.DD_APP_KEY}}
config_path: 'repo/datadog-ci.preview.json'