42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: shell
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run tests (with result capture)
|
|
id: pytest
|
|
run: |
|
|
python -m pytest tests/ -v
|
|
echo "PYTEST_EXIT=$?" >> $GITHUB_ENV
|
|
|
|
- name: Report success
|
|
if: success()
|
|
run: echo "Tests passed - all good!"
|
|
|
|
- name: Report failure
|
|
if: failure()
|
|
run: echo "Tests failed! Would create issue here."
|
|
|
|
- name: Create failure issue
|
|
if: failure()
|
|
run: |
|
|
echo "Creating issue..."
|
|
python scripts/create_failure_issue.py \
|
|
--sha "${{ github.sha }}" \
|
|
--branch "${{ github.ref_name }}" \
|
|
--run "${{ github.run_number }}" \
|
|
--message "${{ github.event.head_commit.message }}" \
|
|
--api-token "${{ secrets.document_analyzer }}"
|