chore(build): remove sphinx.yml (#92) #406
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: Test | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
defaults: | |
run: | |
shell: bash -e {0} | |
jobs: | |
check: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: "requirements-dev.txt" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Run pytest and capture output | |
run: | | |
pytest --cache-clear --color=no --cov --cov-report=xml | tee pytest_output.txt | |
# 检查 pytest 的退出状态码 | |
if test ${PIPESTATUS[0]} -eq 0; then | |
echo '<details><summary>Output</summary>' >> $GITHUB_STEP_SUMMARY | |
echo '' >> $GITHUB_STEP_SUMMARY | |
echo '```python' >> $GITHUB_STEP_SUMMARY | |
cat pytest_output.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
echo '</details>' >> $GITHUB_STEP_SUMMARY | |
else | |
echo '```python' >> $GITHUB_STEP_SUMMARY | |
cat pytest_output.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
fi | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} |