Added server status API endpoint #326
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend test coverage | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
MIN_COVERAGE: 40 | |
jobs: | |
backend-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
working-directory: backend | |
run: yarn | |
- name: Run backend tests | |
working-directory: backend | |
run: yarn test-ci | |
- name: Check test coverage | |
working-directory: backend | |
run: | | |
pct=$(cat coverage/coverage-summary.json | jq -r '.total.lines.pct') | |
echo "current test coverage: $pct% (min required: $MIN_COVERAGE%)" | |
if (( pct < $MIN_COVERAGE )); then | |
exit 1 | |
fi | |
# We need to create a empty "frontend" folder to silence below vercel build error and allow "Ignored Build Step" to run | |
# which will stop vercel build for "gh-pages" | |
# Error: The specified Root Directory "frontend" does not exist. Please update your Project Settings. | |
- name: Creating empty frontend folder | |
run: | | |
mkdir -p ./backend/coverage/frontend | |
touch ./backend/coverage/frontend/empty | |
tree -I node_modules | |
- name: Move coverage report to gh-pages branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./backend/coverage | |
publish_branch: gh-pages |