forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (92 loc) · 3.86 KB
/
copilot-setup-steps.yml
File metadata and controls
105 lines (92 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
permissions: {}
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
timeout-minutes: 45
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# Need contents: read to clone the repository and access source code
contents: read
env:
# Enable Docker BuildKit for faster builds and caching
DOCKER_BUILDKIT: 1
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false
- name: Set up Ruby
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
bundler-cache: true
- name: Install system dependencies
run: |
echo "Installing system dependencies..."
sudo apt-get update
sudo apt-get install -y build-essential curl git shellcheck
- name: Install Ruby dependencies
run: |
echo "Installing Ruby gems..."
bundle install
- name: Verify Ruby environment and gems
run: |
echo "Ruby version: $(ruby --version)"
echo "Bundler version: $(bundle --version)"
echo "Verifying gem dependencies..."
bundle exec tapioca gem --verify
- name: Verify Sorbet type checking
run: |
echo "Running Sorbet type checking..."
if bundle exec srb tc; then
echo "✓ Sorbet type checking passed"
else
echo "⚠ Sorbet type checking found errors (expected during development)"
echo "This is normal during active development - Copilot will resolve type errors"
echo "Run 'bundle exec srb tc' locally to see specific errors"
fi
- name: Verify linting tools
run: |
echo "Testing rubocop..."
bundle exec rubocop --version
echo "Testing shellcheck..."
shellcheck --version
- name: Verify development environment
run: |
echo "Verifying Docker is available..."
docker --version
echo "Verifying script/build is available..."
if [ -x "./script/build" ]; then
echo "✓ script/build is available for CI development"
else
echo "✗ script/build not found"
exit 1
fi
echo "Testing dry-run script..."
./bin/dry-run.rb --help 2>&1 | head -5 || echo "dry-run requires container (expected)"
- name: Display environment summary
run: |
echo "=== Copilot Development Environment Ready ==="
echo "Ruby: $(ruby --version)"
echo "Docker: $(docker --version)"
echo ""
echo "Copilot coding agent workflow:"
echo " 1. script/build {ecosystem}"
echo " 2. docker run --rm ghcr.io/dependabot/dependabot-updater-{ecosystem} bash -c 'cd /home/dependabot/{ecosystem} && rspec spec'"
echo " 3. docker run --rm ghcr.io/dependabot/dependabot-updater-{ecosystem} bash -c 'cd /home/dependabot/{ecosystem} && rubocop && rubocop -A'"
echo " 4. docker run --rm ghcr.io/dependabot/dependabot-updater-{ecosystem} bash -c 'cd /home/dependabot && bundle exec srb tc'"
echo ""
echo "Environment setup complete - Copilot can now develop Dependabot Core"