Copilot Setup Steps File

This appendix contains the complete .github/workflows/copilot-setup-steps.yml file used to configure the GitHub Copilot coding agent’s environment.

.github/workflows/copilot-setup-steps.yml
# GitHub Copilot Setup Steps for lab-manual
#
# This workflow configures the GitHub Copilot coding agent's environment
# by preinstalling R, Quarto and TinyTeX for rendering the lab manual.
#
# See: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
#
# This workflow sets up:
# - R for executing R code chunks in Quarto documents
# - Quarto CLI for rendering
# - TinyTeX for PDF output

name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation,
# and allow manual testing through the repository's "Actions" tab
on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

jobs:
  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
  copilot-setup-steps:
    runs-on: ubuntu-latest

    # Set the permissions to the lowest permissions possible needed for your steps.
    # Copilot will be given its own token for its operations.
    permissions:
      contents: read

    # Timeout after 55 minutes (max is 59 for copilot-setup-steps)
    timeout-minutes: 55

    steps:
      # Checkout code - Copilot will do this automatically if we don't,
      # but we need it to install dependencies from renv.lock
      - name: Checkout code
        uses: actions/checkout@v4

      # R and renv setup steps disabled for now - we don't have any R code to run yet
      # When R code is needed, uncomment the following steps:

      # Install system dependencies required for R packages
      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            libcurl4-openssl-dev \
            libssl-dev \
            libxml2-dev \
            libfontconfig1-dev \
            libharfbuzz-dev \
            libfribidi-dev \
            libfreetype6-dev \
            libpng-dev \
            libtiff5-dev \
            libjpeg-dev

      # Set up pandoc for documentation
      - name: Set up Pandoc
        uses: r-lib/actions/setup-pandoc@v2

      # Set up R using the standard GitHub Actions setup
      - name: Set up R
        uses: r-lib/actions/setup-r@v2
        with:
          r-version: 'release'
          use-public-rspm: true

      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y jags libcurl4-openssl-dev libpng-dev libfontconfig1-dev libjpeg-dev

      - uses: r-lib/actions/setup-renv@v2

      # Set up Quarto - required for rendering the website
      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
          tinytex: true

      # # Install R dependencies using renv (disabled for now - no renv.lock file yet)
      # - name: Install R dependencies via renv
      #   uses: r-lib/actions/setup-renv@v2
      #   with:
      #     cache-version: 1

      # Verify development environment
      - name: Verify development environment
        run: |
          echo "=== Development Environment Status ==="

          # Verify R is installed and working
          echo ""
          echo "=== R Status ==="
          R --version

          # Verify Quarto is installed and working
          echo ""
          echo "=== Quarto Status ==="
          quarto --version
          quarto list tools

          echo ""
          echo "Development environment setup complete!"