1
+ name : Copilot Environment Setup
2
+
3
+ # This workflow sets up the development environment for GitHub Copilot coding agent
4
+ # It ensures all necessary tools and dependencies are available for automated coding tasks
5
+
6
+ on :
7
+ workflow_dispatch : # Allow manual triggering
8
+ schedule :
9
+ # Run weekly to keep the environment fresh
10
+ - cron : ' 0 2 * * 1' # Monday at 2 AM UTC
11
+ push :
12
+ branches : [main]
13
+ paths :
14
+ - ' rust-toolchain.toml'
15
+ - ' Cargo.toml'
16
+ - ' .github/workflows/copilot-environment.yml'
17
+
18
+ jobs :
19
+ setup-environment :
20
+ name : Setup Copilot Coding Agent Environment
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Checkout repository
25
+ uses : actions/checkout@v4
26
+
27
+ - name : Setup Rust toolchain from rust-toolchain.toml
28
+ uses : dtolnay/rust-toolchain@stable
29
+ # This action automatically reads rust-toolchain.toml and installs the specified components
30
+
31
+ - name : Verify Rust installation
32
+ run : |
33
+ # Verify installations
34
+ rustc --version
35
+ cargo --version
36
+ rustfmt --version
37
+ cargo clippy --version
38
+ rust-analyzer --version || echo "rust-analyzer available through rustup"
39
+
40
+ - name : Cache Cargo dependencies
41
+ uses : actions/cache@v4
42
+ with :
43
+ path : |
44
+ ~/.cargo/bin/
45
+ ~/.cargo/registry/index/
46
+ ~/.cargo/registry/cache/
47
+ ~/.cargo/git/db/
48
+ target/
49
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
50
+ restore-keys : |
51
+ ${{ runner.os }}-cargo-
52
+
53
+ - name : Install additional development tools
54
+ run : |
55
+ # Install tools commonly needed for Rust development and Azure SDK
56
+ cargo install cargo-audit || echo "cargo-audit already installed or failed to install"
57
+ cargo install cargo-outdated || echo "cargo-outdated already installed or failed to install"
58
+
59
+ # Install system dependencies that might be needed for Azure SDK
60
+ sudo apt-get update
61
+ sudo apt-get install -y build-essential pkg-config libssl-dev
62
+
63
+ - name : Azure SDK specific setup
64
+ run : |
65
+ # Check that we can work with Azure SDK specific dependencies
66
+ echo "Checking OpenSSL version for Azure connections:"
67
+ openssl version
68
+
69
+ # Verify important system libraries are available
70
+ pkg-config --exists openssl || echo "OpenSSL pkg-config not found"
71
+
72
+ # Check that we have necessary build tools
73
+ which make
74
+ which gcc || which clang
75
+
76
+ - name : Verify workspace setup
77
+ run : |
78
+ # Verify the workspace can be built
79
+ cargo check --workspace --all-targets
80
+
81
+ # Run basic linting
82
+ cargo clippy --workspace --all-targets -- -D warnings
83
+
84
+ # Check formatting
85
+ cargo fmt --all -- --check
86
+
87
+ - name : Setup environment variables
88
+ run : |
89
+ echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
90
+ echo "CARGO_TERM_COLOR=always" >> $GITHUB_ENV
91
+ echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
92
+
93
+ - name : Test basic functionality
94
+ run : |
95
+ # Test that we can run basic cargo commands
96
+ cargo --version
97
+ cargo tree --workspace | head -20
98
+
99
+ # Verify that tests can be discovered
100
+ cargo test --workspace --no-run
101
+
102
+ - name : Environment summary
103
+ run : |
104
+ echo "=== Rust Environment Summary ==="
105
+ rustc --version
106
+ cargo --version
107
+ echo "=== Installed Components ==="
108
+ rustup component list --installed
109
+ echo "=== Workspace Structure ==="
110
+ find . -name "Cargo.toml" | head -10
111
+ echo "=== Environment Ready for Copilot Coding Agent ==="
0 commit comments