-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (80 loc) · 2.85 KB
/
_scheduled-test.yml
File metadata and controls
89 lines (80 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "Scheduled Test"
on:
workflow_call:
# No inputs needed at this time
jobs:
test-scheduled:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
with:
version: "0.6.3"
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install dev tools
shell: bash
run: .github/workflows/_install_dev_tools.bash
- name: Install Python, venv and dependencies
run: uv sync --all-extras --frozen --link-mode=copy
- name: Create .env file
uses: SpicyPizza/create-envfile@ace6d4f5d7802b600276c23ca417e669f1a06f6f # v2.0.3
with:
envkey_OE_PYTHON_TEMPLATE_EXAMPLE_LOGFIRE_TOKEN: "${{ secrets.OE_PYTHON_TEMPLATE_EXAMPLE_LOGFIRE_TOKEN }}"
envkey_OE_PYTHON_TEMPLATE_EXAMPLE_SENTRY_DSN: "${{ secrets.OE_PYTHON_TEMPLATE_EXAMPLE_SENTRY_DSN }}"
fail_on_empty: false
- name: Audit
run: make audit
- name: Test / scheduled
run: |
set +e
make test_scheduled
EXIT_CODE=$?
# Show test execution in GitHub Job summary
found_files=0
for file in reports/pytest_*.md; do
if [ -f "$file" ]; then
cat "$file" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
found_files=1
fi
done
if [ $found_files -eq 0 ]; then
echo "# All scheduled tests passed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi
# Show test coverage in GitHub Job summary
if [ -f "reports/coverage.md" ]; then
cat "reports/coverage.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
else
echo "# No test coverage computed." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi
exit $EXIT_CODE
- name: Upload test results
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
if: ${{ always() && (env.GITHUB_WORKFLOW_RUNTIME != 'ACT') }}
with:
name: test-results-scheduled
path: |
reports/mypy_junit.xml
reports/sbom.json
reports/sbom.spdx
reports/licenses.csv
reports/licenses.json
reports/licenses_grouped.json
reports/vulnerabilities.json
reports/junit.xml
reports/coverage.xml
reports/coverage.md
reports/coverage_html
oe_python_template_example.log
retention-days: 7