Admin UI tweaks #22
Workflow file for this run
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: basic-foundation-test | |
on: | |
push: | |
branches: | |
- '*' # all branches | |
pull_request: | |
branches: | |
- main # PRs to the main branch | |
jobs: | |
install-migrate-test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: api | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12.1" | |
- name: Bootstrap poetry | |
run: | | |
if [ ! -x "$(command -v poetry)" ]; then | |
curl -sSL https://install.python-poetry.org | python - -y | |
fi | |
- name: Configure poetry | |
run: poetry config virtualenvs.in-project true | |
- name: Create CI .env file | |
run: | | |
cp .env.ci .env | |
- name: Install dependencies | |
run: | | |
make install | |
- name: Run dbmate migrations | |
run: | | |
make migrate-up | |
- name: Run init data | |
run: | | |
make init-data | |
- name: Run type checks | |
run: | | |
make type-check | |
- name: Run foundation tests | |
run: | | |
make test-foundation | |
- name: Run foundation tests | |
run: | | |
make test-modules-api | |
- name: Install Playwright and dependencies | |
run: | | |
POETRY_CACHE_DIR=~/.cache/pypoetry_cache | |
mkdir -p $POETRY_CACHE_DIR | |
poetry run playwright install --with-deps | |
- name: Start fastapi | |
run: | | |
make run & | |
for i in {1..5}; do | |
echo "Waiting for FastAPI to start... $i second(s)" | |
sleep 1 | |
done | |
- name: Run Playwright tests | |
run: | | |
make test-modules-web | |
- name: Upload Playwright Traces | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-traces | |
path: test-results/ | |
- name: Run coverage check | |
run: | | |
make test-coverage > coverage.txt | |
echo "## Coverage Report" > coverage.md | |
echo "" >> coverage.md | |
echo "| Name | Statements | Missed | Branch | BrPart | Coverage | Missing |" >> coverage.md | |
echo "| ---- | ---------- | ------ | ------ | ------ | -------- | ------- |" >> coverage.md | |
tail -n +3 coverage.txt | sed -e 's/^|/||/;s/$/|/' | awk 'BEGIN{OFS="|"} {NF=NF + 1; $1=$1} 1' | sed 's/|/ | /g' >> coverage.md | |
- name: Display coverage report in job summary | |
run: cat coverage.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: htmlcov/ |