Repository navigation
98 lines (80 loc) · 3.25 KB
/
Copy pathcopilot-setup-steps.yml
File metadata and controls
98 lines (80 loc) · 3.25 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
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: write
steps:
- name: Checkout repository
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- name: Set up Rust toolchain
run: rustup show
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
shared-key: "rust-cache-${{ hashFiles('**/Cargo.lock', '.cargo/config.toml') }}"
cache-on-failure: true
- name: Set up uv
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
with:
enable-cache: true
activate-environment: true
ignore-nothing-to-cache: true
python-version: 3.12
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: latest
- name: Install Python dependencies
run: uv sync --all-groups
- name: Install lefthook
run: lefthook install
- name: Install cargo-insta
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: cargo-insta
- name: Install cargo-nextest
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: cargo-nextest
- name: Install taplo
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: taplo
- name: Install typos
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: typos-cli
- name: Verify installation
run: |
echo "🦀 Rust toolchain:"
rustc --version
cargo --version
echo "🐍 Python environment:"
python --version
uv --version
echo "📦 Node.js tools:"
bun --version
echo "🔧 Development tools:"
cargo insta --version
cargo nextest --version
taplo --version
typos --version
echo "🧪 Testing lefthook tools via bunx:"
echo "✓ bunx can access dprint: $(bunx dprint --version > /dev/null 2>&1 && echo 'yes' || echo 'no')"
echo "✓ bunx can access commitlint: $(bunx commitlint --version > /dev/null 2>&1 && echo 'yes' || echo 'no')"