Skip to content

[pre-commit.ci] pre-commit autoupdate (#17) #46

[pre-commit.ci] pre-commit autoupdate (#17)

[pre-commit.ci] pre-commit autoupdate (#17) #46

Workflow file for this run

name: Test CI
on:
pull_request:
push:
tags:
- "v*"
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
style:
name: Check code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
frontend_testing:
name: Frontend verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: yarn
working-directory: frontend/
- name: Build project
run: yarn run build
working-directory: frontend/
build:
name: Unit Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install library
run: |
pip install .[dev]
pip list
- name: Test with pytest
run: pytest
docker_test:
name: Docker Build Test
runs-on: ubuntu-latest
needs: [style, frontend_testing, build]
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
run: docker build -t pyvista-webapp .
- name: Run Docker Container
run: |
docker run -d --name pyvista_container -p 8000:8000 pyvista-webapp
echo "Container started, beginning health checks..."
- name: Health Check
run: |
for i in {1..10}; do
curl --fail http://localhost:8000/health && echo "Health check passed" && exit 0
echo "Waiting for health check..."
sleep 10
done
echo "Health check failed"
exit 1