Skip to content

Bump version: 0.2.20 β†’ 0.2.21 #137

Bump version: 0.2.20 β†’ 0.2.21

Bump version: 0.2.20 β†’ 0.2.21 #137

# .github/workflows/test.yml
name: "CI"
on:
push:
branches:
- "**"
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y libcairo2
- name: Install dev tools
run: |
sudo apt-get install -y curl jq xsltproc gnupg2 libcairo2
- name: Install uv (python package manager)
uses: astral-sh/setup-uv@v5
with:
version: "0.5.9"
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install Python, venv and dependencies
run: |
uv sync --all-extras --frozen --link-mode=copy
- name: Release version check
if: startsWith(github.ref, 'refs/tags/v')
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
TOML_VERSION=$(uv run python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$TAG_VERSION" != "$TOML_VERSION" ]; then
echo "Release version mismatch: Tag $TAG_VERSION != pyproject.toml $TOML_VERSION"
exit 1
fi
- name: Print development version info
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
TOML_VERSION=$(uv run python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Development build - Current version in pyproject.toml: $TOML_VERSION"
- name: Create .env file
uses: SpicyPizza/[email protected]
with:
envkey_BRAVE_SEARCH_API_KEY: "${{ secrets.BRAVE_SEARCH_API_KEY }}"
fail_on_empty: true
- name: Validate installation
run: |
OUTPUT=$(uv run brave-search-python-client --help)
if [[ "$OUTPUT" != *"built with love in Berlin"* ]]; then
echo "Output does not contain 'built with love in Berlin'"
exit 1
fi
- name: Run unit tests, measure coverage, lint, and check vulnerabilities
run: |
uv run nox
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
junit.xml
coverage.xml
coverage_html/
vulnerabilities.json
licenses.json
licenses-inverted.json
retention-days: 30
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: helmut-hoffer-von-ankershoffen/brave-search-python-client
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}