fix tests and readme #7
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Build CLI | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build | |
| run: cargo build --release | |
| - name: Upload CLI artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pg0-macos | |
| path: target/release/pg0 | |
| sdk-python: | |
| name: Python SDK Tests | |
| needs: build | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download CLI | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pg0-macos | |
| path: ~/.local/bin | |
| - name: Make CLI executable | |
| run: chmod +x ~/.local/bin/pg0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install dependencies | |
| working-directory: sdk/python | |
| run: uv sync --dev | |
| - name: Run tests | |
| working-directory: sdk/python | |
| run: | | |
| export PATH="$HOME/.local/bin:$PATH" | |
| uv run pytest tests/ -v | |
| sdk-node: | |
| name: Node.js SDK Tests | |
| needs: build | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download CLI | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pg0-macos | |
| path: ~/.local/bin | |
| - name: Make CLI executable | |
| run: chmod +x ~/.local/bin/pg0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| working-directory: sdk/node | |
| run: npm install | |
| - name: Run tests | |
| working-directory: sdk/node | |
| run: | | |
| export PATH="$HOME/.local/bin:$PATH" | |
| npm test | |
| docker-tests: | |
| name: Docker Tests (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: debian-amd64 | |
| runner: ubuntu-latest | |
| script: docker-tests/test_debian_amd64.sh | |
| - platform: debian-arm64 | |
| runner: ubuntu-latest | |
| script: docker-tests/test_debian_arm64.sh | |
| - platform: alpine-amd64 | |
| runner: ubuntu-latest | |
| script: docker-tests/test_alpine_amd64.sh | |
| - platform: alpine-arm64 | |
| runner: ubuntu-latest | |
| script: docker-tests/test_alpine_arm64.sh | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU (for ARM64 emulation) | |
| if: contains(matrix.platform, 'arm64') | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: arm64 | |
| - name: Run Docker test | |
| run: | | |
| chmod +x ${{ matrix.script }} | |
| bash ${{ matrix.script }} |