Fix CI workflow YAML syntax - remove blank lines in apt install #60
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Run all checks | |
| run: just check | |
| test: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Run unit tests | |
| run: just test-unit | |
| smoke-test: | |
| name: Smoke Test (Render Check) | |
| runs-on: ubuntu-latest | |
| needs: build-binary | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libcurl4-openssl-dev \ | |
| pkg-config \ | |
| libglfw3-dev \ | |
| libuv1-dev \ | |
| libz-dev | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Download binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binary-linux-x64 | |
| path: mlnative/bin/ | |
| - name: Fix binary permissions | |
| run: chmod +x mlnative/bin/mlnative-render-linux-x64 | |
| - name: Run smoke test | |
| run: | | |
| echo "Testing basic render functionality..." | |
| uv run python -c " | |
| from mlnative import Map | |
| with Map(256, 256) as m: | |
| png = m.render(center=[0, 0], zoom=1) | |
| print(f'✓ Render successful: {len(png)} bytes') | |
| assert len(png) > 1000, 'PNG too small' | |
| assert png[:4] == b'\\x89PNG', 'Invalid PNG header' | |
| print('✓ Smoke test passed!') | |
| " | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: build-binary | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libcurl4-openssl-dev \ | |
| pkg-config \ | |
| libglfw3-dev \ | |
| libuv1-dev \ | |
| libz-dev | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Download binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binary-linux-x64 | |
| path: mlnative/bin/ | |
| - name: Fix binary permissions | |
| run: chmod +x mlnative/bin/mlnative-render-linux-x64 | |
| - name: Run integration tests | |
| run: | | |
| echo "Running integration tests (actual rendering)..." | |
| uv run python -m pytest tests/ -v -m "integration" --tb=short | |
| build-binary: | |
| name: Build binary ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux-x64 | |
| - os: ubuntu-24.04-arm | |
| platform: linux-arm64 | |
| # macOS builds disabled - maplibre_native crate linking issues on macOS | |
| # See: https://github.com/adonm/mlnative/issues | |
| # - os: macos-15 | |
| # platform: darwin-arm64 | |
| # - os: macos-15-large | |
| # platform: darwin-x64 | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcurl4-openssl-dev pkg-config | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: rust | |
| cache-directories: | | |
| ~/.cargo | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Build binary | |
| run: just ci-build-binary ${{ matrix.platform }} | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.platform }} | |
| path: mlnative/bin/* | |
| build-wheels: | |
| name: Build platform wheels | |
| needs: [build-binary, smoke-test] | |
| runs-on: ${{ matrix.os }} | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux-x64 | |
| - os: ubuntu-24.04-arm | |
| platform: linux-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Download binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.platform }} | |
| path: mlnative/bin/ | |
| - name: Fix binary permissions | |
| run: chmod +x mlnative/bin/* | |
| - name: Build platform wheel | |
| run: just ci-build-wheel ${{ matrix.platform }} | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.platform }} | |
| path: dist/*.whl | |
| build-sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup tools with mise | |
| uses: jdx/mise-action@v2 | |
| with: | |
| install: true | |
| cache: true | |
| - name: Setup project | |
| run: just ci-setup | |
| - name: Build sdist | |
| run: just ci-build-sdist | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| github-release: | |
| name: Create GitHub Release | |
| needs: [build-wheels, build-sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: "wheel-*" | |
| merge-multiple: true | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: List artifacts | |
| run: ls -lh dist/ | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-path: 'dist/*' | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --title "${{ github.ref_name }}" \ | |
| --generate-notes \ | |
| dist/*.whl dist/*.tar.gz | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [build-wheels, build-sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/mlnative | |
| permissions: | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: "wheel-*" | |
| merge-multiple: true | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-path: 'dist/*' | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |