forked from OpenMS/OpenMS
-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (77 loc) · 3.05 KB
/
Copy pathcopilot-setup-steps.yml
File metadata and controls
89 lines (77 loc) · 3.05 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
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-24.04
permissions:
contents: read
# Do not recompile by default – install deps and restore the compiler cache
# so the agent is ready to compile quickly if asked.
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Extract branch/PR info for cache key
id: extract_branch
shell: bash
run: |
if [ -n "${{ github.event.pull_request.number }}" ]; then
echo "RUN_NAME=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
else
echo "RUN_NAME=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Install system dependencies
shell: bash
run: |
bash tools/ci/deps-ubuntu.sh --skip-gui-deps
- name: Install ccache
shell: bash
run: |
# ccache is installed by deps-ubuntu.sh, verify it's available
ccache --version
- name: Restore compiler cache (ccache)
uses: actions/cache/restore@v4
with:
path: .ccache
key: Linux-X64-g++-13-ccache-${{ steps.extract_branch.outputs.RUN_NAME }}
restore-keys: |
Linux-X64-g++-13-ccache-develop
Linux-X64-g++-13-ccache-nightly
Linux-X64-g++-13-ccache-
- name: Show ccache stats
shell: bash
run: |
mkdir -p "${{ github.workspace }}/.ccache"
CCACHE_DIR="${{ github.workspace }}/.ccache" ccache -s || echo "Warning: ccache stats unavailable"
- name: Initialize THIRDPARTY submodule
shell: bash
run: |
git submodule update --init THIRDPARTY
mkdir -p _thirdparty
cp -R "THIRDPARTY/Linux/$(uname -m)"/* _thirdparty/ || { echo "Failed to copy THIRDPARTY/Linux files"; exit 1; }
cp -R THIRDPARTY/All/* _thirdparty/ || { echo "Failed to copy THIRDPARTY/All files"; exit 1; }
- name: Print environment summary
shell: bash
run: |
echo "=== Copilot cloud agent environment ready ==="
echo "OS: $(lsb_release -ds)"
echo "Compiler: $(g++-13 --version | head -1)"
echo "CMake: $(cmake --version | head -1)"
echo "Ninja: $(ninja --version)"
echo "ccache dir: ${{ github.workspace }}/.ccache"
echo ""
echo "To build OpenMS, run something like:"
echo " mkdir build && cd build"
echo " cmake -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \\"
echo " -DCMAKE_CXX_COMPILER=g++-13 \\"
echo " -DCCACHE_DIR=${{ github.workspace }}/.ccache .."
echo " ninja"