Add E2E integration tests with real ampd + Anvil #4
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: E2E Tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**/*.py' | |
| - 'tests/e2e/**' | |
| - '.github/workflows/e2e-tests.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**/*.py' | |
| - 'tests/e2e/**' | |
| - '.github/workflows/e2e-tests.yml' | |
| workflow_dispatch: | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Set up Python 3.12 | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Install PostgreSQL | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql | |
| echo "/usr/lib/postgresql/$(ls /usr/lib/postgresql/)/bin" >> "$GITHUB_PATH" | |
| - name: Install Foundry (anvil) | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| - name: Install amp tools | |
| run: | | |
| gh release download --repo edgeandnode/amp --pattern 'ampd-linux-x86_64' --output /usr/local/bin/ampd | |
| chmod +x /usr/local/bin/ampd | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Verify tools | |
| run: | | |
| anvil --version | |
| ampd --version | |
| initdb --version | |
| postgres --version | |
| - name: Run E2E tests | |
| run: | | |
| uv run pytest tests/e2e/ -v --log-cli-level=INFO -m "e2e" -x | |