Fix campaign creation temp data error and add dashboard report genera… #15
This file contains hidden or 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: API Tests CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: # Allow manual trigger | |
| env: | |
| PYTHON_VERSION: '3.10' | |
| # Required permissions for publish-unit-test-result-action | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Create .env file from secrets | |
| run: | | |
| echo "# Base URL for API" >> .env | |
| echo "BASE_URL=${{ secrets.BASE_URL }}" >> .env | |
| echo "" >> .env | |
| echo "# Tenant Configuration" >> .env | |
| echo "TENANTID=${{ secrets.TENANTID }}" >> .env | |
| echo "LOCALE=${{ secrets.LOCALE }}" >> .env | |
| echo "" >> .env | |
| echo "# Authentication Credentials" >> .env | |
| echo "USERNAME=${{ secrets.USERNAME }}" >> .env | |
| echo "PASSWORD=${{ secrets.PASSWORD }}" >> .env | |
| echo "USERTYPE=${{ secrets.USERTYPE }}" >> .env | |
| echo "CLIENT_AUTH_HEADER=${{ secrets.CLIENT_AUTH_HEADER }}" >> .env | |
| echo "" >> .env | |
| echo "# Search Configuration" >> .env | |
| echo "SEARCH_LIMIT=${{ secrets.SEARCH_LIMIT }}" >> .env | |
| echo "SEARCH_OFFSET=${{ secrets.SEARCH_OFFSET }}" >> .env | |
| echo "" >> .env | |
| echo "# Boundary Configuration" >> .env | |
| echo "HIERARCHYTYPE=${{ secrets.HIERARCHYTYPE }}" >> .env | |
| echo "BOUNDARY_CODE=${{ secrets.BOUNDARY_CODE }}" >> .env | |
| echo "BOUNDARY_TYPE=${{ secrets.BOUNDARY_TYPE }}" >> .env | |
| echo "" >> .env | |
| echo "# Service Endpoints" >> .env | |
| echo "SERVICE_CAMPAIGN=${{ secrets.SERVICE_CAMPAIGN }}" >> .env | |
| echo "SERVICE_PROJECT=${{ secrets.SERVICE_PROJECT }}" >> .env | |
| echo "SERVICE_PROJECT_FACILITY=${{ secrets.SERVICE_PROJECT_FACILITY }}" >> .env | |
| echo "SERVICE_PROJECT_STAFF=${{ secrets.SERVICE_PROJECT_STAFF }}" >> .env | |
| echo "SERVICE_PROJECT_FACTORY=${{ secrets.SERVICE_PROJECT_FACTORY }}" >> .env | |
| - name: Create output directory | |
| run: mkdir -p data/outputs | |
| - name: Run tests | |
| run: | | |
| pytest tests/ -v --tb=short --junitxml=reports/junit.xml --html=reports/report.html --self-contained-html | |
| continue-on-error: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| reports/ | |
| data/outputs/ | |
| retention-days: 30 | |
| - name: Upload JUnit results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: junit-results | |
| path: reports/junit.xml | |
| retention-days: 30 | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| files: reports/junit.xml |