Skip to content

🏷️ Bump up to version 0.0.65 -> 0.0.66. #57

🏷️ Bump up to version 0.0.65 -> 0.0.66.

🏷️ Bump up to version 0.0.65 -> 0.0.66. #57

Workflow file for this run

name: coverage
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
id: cache
with:
path: .venv
key: ${{ runner.os }}-python-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}-ci
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
uv pip install -U pip
uv pip install -e .[all]
uv pip install -U "coverage[toml]" pytest freezegun pytest-asyncio
- name: Use Python virtual environment
run: |
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
# NOTE: I set OS level for timezone because I have schedule object
# testcase.
# TODO: I should seeing this is necessary task on GitHub action, right?
# Because it does not depend on OS level when you pass tz to schedule
# object or not, and it will use UTC for default.
- uses: MathRobin/[email protected]
with:
timezoneLinux: "Asia/Bangkok"
- name: Run coverage and produce a .coverage file
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
run: |
mkdir coverage
echo $COVERAGE_FILE
coverage run -m pytest --disable-pytest-warnings
ls -al ./coverage
- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage
include-hidden-files: true
coverage:
name: coverage
needs: [build]
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Get coverage files
uses: actions/download-artifact@v4
id: download
with:
pattern: coverage-*
path: coverage
merge-multiple: true
- name: Install Python Dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
uv pip install -U pip
uv pip install -U "coverage[toml]" pytest
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Run coverage
run: |
ls -al coverage
coverage combine coverage
coverage report --show-missing
coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
ls -al
- run: |
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Store coverage HTML
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov
check:
if: always()
needs:
- build
- coverage
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}