Skip to content

Commit

Permalink
docs: add coverage link to docs page sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jan 22, 2024
1 parent 148de05 commit 15345c5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
41 changes: 14 additions & 27 deletions .github/workflows/tests/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- staging
- development

permissions:
contents: write

jobs:
run-tests:
runs-on: ubuntu-latest
Expand All @@ -31,11 +34,6 @@ jobs:
# Parse JSON with multiline strings, using delimeter (Github specific)
to_envs() { jq -r "to_entries[] | \"\(.key)<<$delim\n\(.value)\n$delim\n\""; }
# Set all vars
echo "TAG_OVERRIDE=${TAG_OVERRIDE}" >> $GITHUB_ENV
echo "TARGET_OVERRIDE=${TARGET_OVERRIDE}" >> $GITHUB_ENV
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_ENV
# Set VARS_CONTEXT if not null
if [ "${VARS_CONTEXT}" != "null" ]; then
echo "${VARS_CONTEXT}" | to_envs >> $GITHUB_ENV
Expand All @@ -53,16 +51,12 @@ jobs:
curl -L https://github.com/a8m/envsubst/releases/download/v1.2.0/envsubst-`uname -s`-`uname -m` -o envsubst
chmod +x envsubst
# Check if .env.example exists
if [ -f .env.example ]; then
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
else
echo ".env.example not found, creating .env with GIT_BRANCH only"
echo "GIT_BRANCH=${GIT_BRANCH}" > .env
fi
echo "Substituting variables from .env.example --> .env"
./envsubst < .env.example > .env
echo "GIT_BRANCH=${GIT_BRANCH}" >> .env
# Set all vars
echo "TAG_OVERRIDE=${TAG_OVERRIDE}" >> .env
echo "TARGET_OVERRIDE=${TARGET_OVERRIDE}" >> .env
echo "GIT_BRANCH=${GIT_BRANCH}" >> .env
- name: Run Tests With Coverage
Expand All @@ -78,23 +72,16 @@ jobs:
- name: Upload Coverage
run: |
# Pull content from gh-pages
mkdir tmp_pages
cd tmp_pages
git init
git pull https://github.com/${{ github.repository }}.wiki
cd ..
# Sync coverage index and badge using rsync
sudo apt-get update && sudo apt-get install -y rsync --no-install-recommends
# Checkout to gh-pages
git config user.name svchot
git config user.email [email protected]
git checkout gh-pages
# Overwrite coverage index and badge
echo "Coverage dir contents:"
ls ${{ github.workspace }}/coverage
echo ""
cp ${{ github.workspace }}/coverage/coverage.* docs/
rsync -av --delete docs/ tmp_pages/ --exclude .git
mv ${{ github.workspace }}/coverage/* ${{ github.workspace }}
# Assess diff
cd tmp_pages
git --no-pager diff
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ temp_webmaps/Naivasha
# mkdocs
site
docs/apidocs
coverage
**/**/coverage*

# Bash install script
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ nav:
- Versioning: https://docs.hotosm.org/dev-guide/version-control/#creating-releases
- API: https://hotosm.github.io/swagger/?url=https://hotosm.github.io/fmtm/openapi.json
- Class Hierarchy: apidocs/html/inherits.html
- Code Coverage: coverage.html

0 comments on commit 15345c5

Please sign in to comment.