Enable coding agent setup for build and test #9
Workflow file for this run
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: "Copilot Setup Steps" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| pull_request: | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| jobs: | |
| copilot-setup-steps: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 59 | |
| environment: copilot | |
| # Least privilege; checkout needs contents:read. | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install system dependencies for pgrx | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| pkg-config \ | |
| libssl-dev \ | |
| libclang-dev \ | |
| clang \ | |
| bison \ | |
| flex \ | |
| libreadline-dev \ | |
| zlib1g-dev \ | |
| libxml2-dev \ | |
| libxslt1-dev \ | |
| libicu-dev | |
| - name: Install cargo-pgrx | |
| run: cargo install cargo-pgrx --version 0.16.1 --locked | |
| - name: Initialize pgrx (PostgreSQL 17) | |
| run: cargo pgrx init --pg17 download | |
| - name: Verify pgrx installation | |
| run: cargo pgrx --version | |
| # Strongly recommended for private git deps + auth in CI-like envs | |
| - name: Configure Cargo to use git CLI | |
| run: | | |
| mkdir -p ~/.cargo | |
| cat >> ~/.cargo/config.toml << 'EOF' | |
| [net] | |
| git-fetch-with-cli = true | |
| EOF | |
| # Provide non-interactive auth for *all* https://github.com/* git fetches | |
| # using an environment secret in the `copilot` environment. | |
| - name: Configure git auth for private GitHub deps (PAT) | |
| run: | | |
| test -n "${{ secrets.DUROXIDE_PG_OPT_TOKEN }}" | |
| git config --global --add url."https://x-access-token:${{ secrets.DUROXIDE_PG_OPT_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| git config --global --add url."https://x-access-token:${{ secrets.DUROXIDE_PG_OPT_TOKEN }}@github.com/".insteadOf "https://api.github.com/" | |
| # Warm the Cargo git/db caches so later `cargo update/test` is fast and reliable. | |
| - name: Prefetch Rust dependencies (including private git deps) | |
| run: | | |
| cargo fetch |