-
Notifications
You must be signed in to change notification settings - Fork 66
106 lines (85 loc) · 3.25 KB
/
copilot-setup-steps.yml
File metadata and controls
106 lines (85 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
99
100
101
102
103
104
105
106
name: "Copilot Setup Steps"
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log disk space (after checkout)
uses: ./.github/workflows/log-disk-space
- name: Setup build directories on secondary disk
run: |
echo "Setting up build directories on /mnt (secondary disk with 66G+ free)"
sudo mkdir -p /mnt/build-output
sudo mkdir -p /mnt/externals
sudo mkdir -p /mnt/generated
sudo chmod -R 777 /mnt/build-output /mnt/externals /mnt/generated
# Create symlinks to use the secondary disk
ln -s /mnt/build-output ./output
ln -s /mnt/externals ./externals
ln -s /mnt/generated ./generated
echo "Build directories configured:"
ls -la | grep -E "(output|externals|generated)"
df -h /mnt
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- name: Log disk space (after .NET setup)
uses: ./.github/workflows/log-disk-space
- name: Install Android workload
run: dotnet workload install android
- name: Log disk space (after Android workload)
uses: ./.github/workflows/log-disk-space
- name: Setup OpenJDK 21
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '21'
- name: Log disk space (after Java setup)
uses: ./.github/workflows/log-disk-space
- name: Restore dotnet tools
run: dotnet tool restore
- name: Log disk space (after dotnet tools restore)
uses: ./.github/workflows/log-disk-space
# Cache the externals directory based on config.json content
# This caches the Maven artifacts downloaded by the binderator tool
# to avoid re-downloading the same artifacts on subsequent runs
- name: Restore externals cache
id: cache-externals-restore
uses: actions/cache/restore@v4
with:
path: ./externals
key: externals-${{ hashFiles('config.json') }}
- name: Log disk space (after externals cache restore)
uses: ./.github/workflows/log-disk-space
- name: Run dotnet cake
run: dotnet cake
continue-on-error: true
- name: Log disk space (after dotnet cake)
uses: ./.github/workflows/log-disk-space
# Save the externals cache after dotnet cake runs
# This ensures the cache reflects the original config.json state
# before any potential modifications by the build process
- name: Save externals cache
id: cache-externals-save
uses: actions/cache/save@v4
if: steps.cache-externals-restore.outputs.cache-hit != 'true'
with:
path: ./externals
key: externals-${{ hashFiles('config.json') }}
- name: Display environment info
run: |
echo "=== Environment Summary ==="
echo ".NET Version: $(dotnet --version)"
echo "Java Version: $(java -version 2>&1 | head -1)"
echo "Android SDK Root: $ANDROID_SDK_ROOT"
echo "Android Home: $ANDROID_HOME"
echo "Java Home: $JAVA_HOME"
echo "=== Installed Workloads ==="
dotnet workload list