Skip to content

Commit 4cf9f9d

Browse files
Copilotexaby73
andauthored
ci: Add reusable setup action and copilot-setup-steps.yml workflow (#115)
* Initial plan * Create copilot-setup-steps.yml for agent environment setup Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Move copilot-setup-steps.yml to workflows and use GitHub Actions format Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Use consistent action versions and working-directory parameter Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Remove unnecessary comments and use dart install dpk with PATH setup Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Restrict push trigger to main branch only Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Update all workflows to use dart install dpk with PATH setup Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * Create reusable setup-luthor action and update all workflows Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> * chore: Regenerate pubspec.lock --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: exaby73 <50555895+exaby73@users.noreply.github.com> Co-authored-by: Nabeel Parkar <nabeel@ex3.dev>
1 parent 1715cbf commit 4cf9f9d

File tree

8 files changed

+126
-93
lines changed

8 files changed

+126
-93
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Setup Luthor Development Environment'
2+
description: 'Sets up Dart SDK, dpk, and project dependencies for Luthor monorepo'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Set up Dart SDK
8+
uses: dart-lang/setup-dart@v1
9+
10+
- name: Install dpk (Dartpack monorepo CLI)
11+
shell: bash
12+
run: |
13+
dart install dpk
14+
echo "$HOME/.local/state/Dart/install/bin" >> $GITHUB_PATH
15+
16+
- name: Install project dependencies
17+
shell: bash
18+
run: dpk get
19+
20+
- name: Generate code for luthor_generator example
21+
shell: bash
22+
working-directory: packages/luthor_generator/example
23+
run: dart run build_runner build -d

.github/workflows/analyze.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,5 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: dart-lang/setup-dart@v1
15-
- run: dart pub global activate dpk
16-
- run: dpk get
17-
- name: Generate code in example
18-
run: (cd packages/luthor_generator/example && dart run build_runner build -d)
14+
- uses: ./.github/actions/setup-luthor
1915
- run: dpk run analyze
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/workflows/copilot-setup-steps.yml
12+
pull_request:
13+
paths:
14+
- .github/workflows/copilot-setup-steps.yml
15+
16+
jobs:
17+
copilot-setup-steps:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup Luthor
26+
uses: ./.github/actions/setup-luthor

.github/workflows/format.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: dart-lang/setup-dart@v1
15-
- run: dart pub global activate dpk
16-
- run: dpk get
14+
- uses: ./.github/actions/setup-luthor
1715
- run: dpk run format

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: dart-lang/setup-dart@v1
15-
- run: dart pub global activate dpk
16-
- run: dpk get
14+
- uses: ./.github/actions/setup-luthor
1715
- run: dpk run test

packages/luthor_generator/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ environment:
99
sdk: '>=3.8.0 <4.0.0'
1010

1111
dependencies:
12-
analyzer: ^8.0.0
13-
build: ^4.0.0
12+
analyzer: ^8.0.0 # Configured via catalog
13+
build: ^4.0.0 # Configured via catalog
1414
collection: ^1.18.0
1515
dart_mappable: ^4.3.0
1616
freezed_annotation: ^3.0.0
1717
json_annotation: ^4.8.1
1818
luthor: ^0.15.0
19-
source_gen: ^4.0.0
19+
source_gen: ^4.0.0 # Configured via catalog
2020

2121
dev_dependencies:
2222
lint: ^2.3.0

0 commit comments

Comments
 (0)