-
Notifications
You must be signed in to change notification settings - Fork 33
117 lines (94 loc) · 3.59 KB
/
copilot-setup-steps.yml
File metadata and controls
117 lines (94 loc) · 3.59 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
107
108
109
110
111
112
113
114
115
116
117
name: Copilot Setup Steps
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
# fetch-depth will be overridden
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget unzip
- name: Install Chrome and ChromeDriver
run: |
# Install Chrome
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb || sudo apt-get -f install -y
# Install ChromeDriver using Chrome for Testing
CHROME_VERSION=$(google-chrome --version | awk '{print $3}' | cut -d '.' -f 1)
CHROMEDRIVER_URL=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" | \
grep -o '"chromedriver".*"linux64".*"url":"[^"]*' | \
grep -o 'https://[^"]*' | head -1)
wget -q "$CHROMEDRIVER_URL" -O chromedriver-linux64.zip
unzip chromedriver-linux64.zip
sudo mv chromedriver-linux64/chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver
rm -rf chromedriver-linux64*
- name: Install tttool (from releases)
run: |
# Download a specific working version from GitHub releases
# Using the correct URL pattern: tttool-{version}.zip
TTTOOL_VERSION="1.8.1"
echo "Installing tttool version $TTTOOL_VERSION"
# Use system temp directory for extraction
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
wget -q "https://github.com/entropia/tip-toi-reveng/releases/download/${TTTOOL_VERSION}/tttool-${TTTOOL_VERSION}.zip"
# Extract into temp directory
unzip -q "tttool-${TTTOOL_VERSION}.zip"
# Move the binary to /usr/local/bin
chmod +x tttool
sudo mv tttool /usr/local/bin/
# Cleanup - change permissions recursively then remove
cd "$GITHUB_WORKSPACE"
chmod -R u+w "$TEMP_DIR" || true
rm -rf "$TEMP_DIR"
# Verify installation
tttool --help || { echo "Error: tttool installation failed"; exit 1; }
- name: Install ffmpeg (static build)
run: .github/scripts/install-ffmpeg-linux.sh
- name: Install Python dependencies
run: |
uv pip install --system -e ".[dev,test]"
- name: Install pre-commit hooks
run: |
pre-commit install
- name: Prepare test fixtures
run: |
# Bundled test audio file already exists in repo
ls -lh tests/fixtures/test_audio.mp3
# Create test cover image if needed
if [ ! -f tests/fixtures/test_cover.jpg ]; then
python3 -c "from PIL import Image; img = Image.new('RGB', (100, 100), color='green'); img.save('tests/fixtures/test_cover.jpg')"
fi
# Verify files exist
ls -lh tests/fixtures/
- name: Verify setup
run: |
echo "Setup complete. Verifying installations..."
python --version
google-chrome --version
chromedriver --version
tttool --help | head -5
ffmpeg -version | head -5
uv --version
echo "All tools installed successfully!"