Skip to content

ci: Add reusable setup action and copilot-setup-steps.yml workflow#115

Merged
exaby73 merged 9 commits intomainfrom
copilot/create-copilot-setup-steps
Dec 28, 2025
Merged

ci: Add reusable setup action and copilot-setup-steps.yml workflow#115
exaby73 merged 9 commits intomainfrom
copilot/create-copilot-setup-steps

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 28, 2025

Defines a reusable composite action for setting up the Luthor development environment and creates a GitHub Actions workflow for GitHub Copilot agent setup. All existing workflows have been updated to use the new reusable action.

Changes

  • Added .github/actions/setup-luthor/action.yml - a reusable composite action that:

    • Sets up Dart SDK using dart-lang/setup-dart@v1
    • Installs dpk (Dartpack) monorepo CLI via dart install dpk (recommended for Dart 3.10+)
    • Adds $HOME/.local/state/Dart/install/bin to $GITHUB_PATH to make dpk available in subsequent steps
    • Installs project dependencies with dpk get
    • Generates code for luthor_generator example using build_runner
  • Added .github/workflows/copilot-setup-steps.yml - a GitHub Actions workflow that:

    • Uses the new reusable setup-luthor action
    • Job named copilot-setup-steps (required by GitHub Copilot)
    • Permissions: contents: read (minimal permissions)
    • Triggers:
      • Manual trigger via workflow_dispatch
      • Automatic trigger on push to main branch when the workflow file changes
      • Automatic trigger on pull requests when the workflow file changes
  • Updated all existing workflows to use the reusable action:

    • .github/workflows/analyze.yml - Static analysis workflow
    • .github/workflows/unit_tests.yml - Unit tests workflow
    • .github/workflows/format.yml - Code formatting workflow

Benefits

  • Single source of truth: All setup logic is centralized in one reusable composite action
  • DRY principle: No duplication of setup steps across workflows
  • Easier maintenance: Updates to setup only need to be made in one place
  • Consistency: All workflows use identical setup steps
  • Cleaner workflows: Each workflow is now more concise and focused on its specific task

The reusable action and workflows follow the standard GitHub Actions best practices and align with the setup instructions in .github/copilot-instructions.md.

Original prompt

This section details on the original issue you should resolve

<issue_title>Create copilot-setup-steps.yml for setting up agent environment</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add copilot-setup-steps.yml for agent environment setup Add copilot-setup-steps.yml for agent environment configuration Dec 28, 2025
Copilot AI requested a review from exaby73 December 28, 2025 05:42
@exaby73
Copy link
Copy Markdown
Owner

exaby73 commented Dec 28, 2025

@copilot Also for the Dart SDK, can't you use the Dart GitHub action?

@exaby73
Copy link
Copy Markdown
Owner

exaby73 commented Dec 28, 2025

@copilot Here's an example of the setup steps from your own docs 🤦

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:
      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
      contents: read

    # You can define any steps you want, and they will run before the agent starts.
    # If you do not check out your code, Copilot will do this for you.
    steps:
      - name: Checkout code
        uses: actions/checkout@v5

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install JavaScript dependencies
        run: npm ci

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 28, 2025

@copilot Here's an example of the setup steps from your own docs 🤦

Fixed in commit aca6025. The file is now a proper GitHub Actions workflow at .github/workflows/copilot-setup-steps.yml that uses dart-lang/setup-dart@v1 action and follows the standard Copilot setup steps format.

Copilot AI changed the title Add copilot-setup-steps.yml for agent environment configuration Add copilot-setup-steps.yml workflow for agent environment configuration Dec 28, 2025
@exaby73 exaby73 marked this pull request as ready for review December 28, 2025 06:02
@exaby73
Copy link
Copy Markdown
Owner

exaby73 commented Dec 28, 2025

@copilot rebase with main and also please only run the push trigger on push to main

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 28, 2025

@copilot rebase with main and also please only run the push trigger on push to main

Updated in commit 5e23d65 to restrict push trigger to main branch only. Note: I cannot perform git rebase operations directly, but the changes are ready to be merged into main when the PR is approved.

Copilot AI and others added 6 commits December 28, 2025 11:44
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
@exaby73 exaby73 force-pushed the copilot/create-copilot-setup-steps branch from 5e23d65 to 7fbfff2 Compare December 28, 2025 06:14
@exaby73 exaby73 changed the title Add copilot-setup-steps.yml workflow for agent environment configuration ai: Add copilot-setup-steps.yml workflow for agent environment configuration Dec 28, 2025
@exaby73 exaby73 changed the title ai: Add copilot-setup-steps.yml workflow for agent environment configuration ci: Add copilot-setup-steps.yml workflow for agent environment configuration Dec 28, 2025
@exaby73
Copy link
Copy Markdown
Owner

exaby73 commented Dec 28, 2025

@copilot Can you update other workflows to use the same installation steps for dpk?

Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 28, 2025

@copilot Can you update other workflows to use the same installation steps for dpk?

Updated in commit 7833f1b. All workflows (analyze.yml, unit_tests.yml, and format.yml) now use dart install dpk with PATH setup, matching copilot-setup-steps.yml.

Copilot AI and others added 2 commits December 28, 2025 06:21
Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com>
Copilot AI changed the title ci: Add copilot-setup-steps.yml workflow for agent environment configuration ci: Add reusable setup action and copilot-setup-steps.yml workflow Dec 28, 2025
@exaby73 exaby73 merged commit 4cf9f9d into main Dec 28, 2025
6 checks passed
@exaby73 exaby73 deleted the copilot/create-copilot-setup-steps branch December 28, 2025 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create copilot-setup-steps.yml for setting up agent environment

2 participants