test: fix #211
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: ["main"] | |
| tags: [ "v*.*.*" ] | |
| pull_request: | |
| workflow_call: | |
| workflow_dispatch: | |
| jobs: | |
| tests: | |
| name: ✅ Run tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
| os: ["ubuntu-latest"] | |
| python-version: ["3.11", "3.12", "3.13"] | |
| # onnxruntime not available for "3.14" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run tests | |
| run: uv run pytest | |
| docker: | |
| name: 🐳 Build Docker image | |
| runs-on: ubuntu-latest | |
| # needs: tests | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # - name: Log in to GitHub Container Registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ghcr.io | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/sib-swiss/sparql-llm | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build Docker image | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64, linux/arm64 | |
| push: false | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # outputs: type=image,name=ghcr.io/eosc-data-commons/data-commons-mcp,push-by-digest=true,name-canonical=true,push=true | |
| generate-changelog: | |
| name: 🏔️ Generate changelog for the GitHub release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate a changelog | |
| uses: orhun/git-cliff-action@v4 | |
| id: git-cliff | |
| with: | |
| config: cliff.toml | |
| args: -vv --latest --strip header | |
| env: | |
| OUTPUT: CHANGES.md | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: CHANGES.md |