Merge pull request #20 from shrug-labs/rigebha/publish #1
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: Matrix Build | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: get-directories | |
| strategy: | |
| matrix: | |
| directory: ${{ fromJson(needs.get-directories.outputs.directories) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.8.19" | |
| - name: Install tomlq | |
| run: pip install tomlq | |
| - name: Update __init__.py | |
| working-directory: src/${{ matrix.directory }} | |
| run: | | |
| name=$(uv run tomlq -r '.project.name' pyproject.toml) | |
| version=$(uv run tomlq -r '.project.version' pyproject.toml) | |
| if [ -d oracle/*_mcp_server ]; then | |
| init_py_file=oracle/*_mcp_server/__init__.py | |
| echo "\"\"\"\nCopyright (c) 2025, Oracle and/or its affiliates.\nLicensed under the Universal Permissive License v1.0 as shown at\nhttps://oss.oracle.com/licenses/upl.\n\"\"\"\n" > $$init_py_file; \ | |
| echo "__project__ = \"$name\"" >> $init_py_file | |
| echo "__version__ = \"$version\"" >> $init_py_file | |
| fi | |
| - name: Sync | |
| working-directory: src/${{ matrix.directory }} | |
| run: uv sync --locked --all-extras --dev | |
| - name: Test | |
| working-directory: src/${{ matrix.directory }} | |
| run: uv run pytest | |
| - name: Build | |
| working-directory: src/${{ matrix.directory }} | |
| run: uv build | |
| - name: Test install | |
| working-directory: src/${{ matrix.directory }} | |
| run: uv pip install . | |
| get-directories: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| directories: ${{ steps.get-directories.outputs.directories }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get directories | |
| id: get-directories | |
| run: | | |
| directories=$(ls src | grep -v dbtools-mcp-server | grep -v mysql-mcp-server | grep -v oci-pricing-mcp-server | jq -R -s -c 'split("\n")[:-1]') | |
| echo "directories=$directories" >> $GITHUB_OUTPUT |