Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Tsuyoshi Hombashi <[email protected]>
  • Loading branch information
thombashi committed Jan 1, 2025
1 parent 339ba9f commit 659fae2
Showing 1 changed file with 57 additions and 37 deletions.
94 changes: 57 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,22 @@ jobs:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-lint
cancel-in-progress: true
timeout-minutes: 20
container:
image: ghcr.io/thombashi/python-ci:3.13

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci

- run: make check

Expand All @@ -100,14 +111,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
python-version: "pypy3.10"
- os: windows-latest
python-version: "pypy3.10"

steps:
- uses: actions/checkout@v4
Expand All @@ -124,39 +129,51 @@ jobs:
- run: make setup-ci

- run: make test-py
- name: Run tests
env:
REPORT_OUTPUT: md_report.md
run: |
echo "REPORT_FILE=${REPORT_OUTPUT}" >> "$GITHUB_ENV"
tox -e cov -- --md-report-output "${REPORT_OUTPUT}"
timeout-minutes: 20

coverage:
- name: Output reports to the job summary when tests fail
if: failure()
shell: bash
run: |
if [ -f "$REPORT_FILE" ]; then
echo "<details><summary>Failed Test Report</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
else
echo "No failed tests to report"
fi
- name: Install coveralls
run: python -m pip install --upgrade --disable-pip-version-check coveralls tomli

- name: Upload coverage data to coveralls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: coveralls

coveralls:
name: Indicate completion to coveralls.io
needs: unit-test
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-coverage
cancel-in-progress: true
timeout-minutes: 20
container: python:3-slim

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make setup-ci
- run: pip3 install --upgrade coveralls

- name: Run tests
run: tox -e cov

- name: Upload coverage report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install --upgrade --disable-pip-version-check coveralls tomli
coveralls --service=github
- name: Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --finish

smoke-examples:
runs-on: ubuntu-latest
Expand All @@ -166,6 +183,9 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit 659fae2

Please sign in to comment.