Skip to content

Commit 3493fdd

Browse files
committed
Fixing workflows
1 parent db44d1f commit 3493fdd

File tree

20 files changed

+1562
-277
lines changed

20 files changed

+1562
-277
lines changed

.github/workflows/python-release.yml

Lines changed: 35 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Python Artifacts
22

33
env:
4-
TRIGGER_ON_PR_PUSH: false # Set to true to enable triggers on PR pushes
4+
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
55
PYTHON_VERSION: '3.10'
66

77
on:
@@ -66,20 +66,13 @@ jobs:
6666
with:
6767
python-version: ${{ env.PYTHON_VERSION }}
6868

69-
- name: Install the latest version of uv
70-
uses: astral-sh/setup-uv@v4
71-
with:
72-
enable-cache: true
73-
ignore-nothing-to-cache: true
74-
cache-dependency-glob: |
75-
**/pyproject.toml
76-
**/requirements*.txt
77-
**/uv.lock
78-
7969
- name: Remove conflicting README.md
8070
run: |
8171
if [ -f crates/pecos-python/README.md ]; then
8272
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
73+
echo "Moved conflicting README.md to README.md.bak"
74+
else
75+
echo "No conflicting README.md found"
8376
fi
8477
8578
- name: Build pecos-rslib SDist
@@ -94,13 +87,15 @@ jobs:
9487
run: |
9588
if [ -f crates/pecos-python/README.md.bak ]; then
9689
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
90+
echo "Restored README.md from backup"
91+
else
92+
echo "No README.md backup found"
9793
fi
9894
99-
- name: Install and test pecos-rslib SDist
95+
- name: Test pecos-rslib SDist
10096
run: |
101-
uv sync --project .
102-
uv pip install --force-reinstall python/pecos-rslib/dist/*.tar.gz
103-
uv run python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
97+
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.tar.gz
98+
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
10499
105100
- name: Upload pecos-rslib SDist
106101
uses: actions/upload-artifact@v4
@@ -135,20 +130,13 @@ jobs:
135130
with:
136131
python-version: ${{ matrix.python-version }}
137132

138-
- name: Install the latest version of uv
139-
uses: astral-sh/setup-uv@v4
140-
with:
141-
enable-cache: true
142-
ignore-nothing-to-cache: true
143-
cache-dependency-glob: |
144-
**/pyproject.toml
145-
**/requirements*.txt
146-
**/uv.lock
147-
148133
- name: Remove conflicting README.md
149134
run: |
150135
if [ -f crates/pecos-python/README.md ]; then
151136
mv crates/pecos-python/README.md crates/pecos-python/README.md.bak
137+
echo "Moved conflicting README.md to README.md.bak"
138+
else
139+
echo "No conflicting README.md found"
152140
fi
153141
154142
- name: Build wheel
@@ -165,14 +153,16 @@ jobs:
165153
run: |
166154
if [ -f crates/pecos-python/README.md.bak ]; then
167155
mv crates/pecos-python/README.md.bak crates/pecos-python/README.md
156+
echo "Restored README.md from backup"
157+
else
158+
echo "No README.md backup found"
168159
fi
169160
170161
- name: Test wheel
171162
if: ${{ !(matrix.architecture == 'x86_64' && matrix.os == 'macos-latest') && matrix.architecture != 'aarch64' }}
172163
run: |
173-
uv sync --project .
174-
uv pip install --force-reinstall python/pecos-rslib/dist/*.whl
175-
uv run python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
164+
pip install --force-reinstall --verbose python/pecos-rslib/dist/*.whl
165+
python -c 'import pecos_rslib; print(pecos_rslib.__version__)'
176166
177167
- name: Upload wheel
178168
uses: actions/upload-artifact@v4
@@ -197,38 +187,29 @@ jobs:
197187
with:
198188
python-version: ${{ env.PYTHON_VERSION }}
199189

200-
- name: Install the latest version of uv
201-
uses: astral-sh/setup-uv@v4
202-
with:
203-
enable-cache: true
204-
ignore-nothing-to-cache: true
205-
cache-dependency-glob: |
206-
**/pyproject.toml
207-
**/requirements*.txt
208-
**/uv.lock
209-
210190
- name: Download pecos-rslib wheel
211191
uses: actions/download-artifact@v4
212192
with:
213193
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ env.PYTHON_VERSION }}
214194
path: ./pecos-rslib-wheel
215195

216-
- name: Setup environment and install dependencies
196+
- name: Install pecos-rslib
197+
run: pip install ./pecos-rslib-wheel/*.whl
198+
199+
- name: Install build dependencies
217200
run: |
218-
uv sync --project .
219-
uv pip install ./pecos-rslib-wheel/*.whl
220-
uv pip install build
201+
python -m pip install --upgrade pip
202+
pip install build
221203
222204
- name: Build quantum-pecos SDist
223205
run: |
224206
cd python/quantum-pecos
225-
uv pip install --system build
226207
python -m build --sdist --outdir dist
227208
228209
- name: Test quantum-pecos SDist
229210
run: |
230-
uv pip install python/quantum-pecos/dist/*.tar.gz
231-
uv run python -c 'import pecos; print(pecos.__version__)'
211+
pip install python/quantum-pecos/dist/*.tar.gz
212+
python -c 'import pecos; print(pecos.__version__)'
232213
233214
- name: Upload quantum-pecos SDist
234215
uses: actions/upload-artifact@v4
@@ -252,30 +233,24 @@ jobs:
252233
with:
253234
ref: ${{ inputs.sha || github.sha }}
254235

255-
- name: Set up Python
236+
- name: Set up Python ${{ matrix.python-version }}
256237
uses: actions/setup-python@v5
257238
with:
258239
python-version: ${{ matrix.python-version }}
259240

260-
- name: Install the latest version of uv
261-
uses: astral-sh/setup-uv@v4
262-
with:
263-
enable-cache: true
264-
ignore-nothing-to-cache: true
265-
cache-dependency-glob: |
266-
**/pyproject.toml
267-
**/requirements*.txt
268-
**/uv.lock
269-
270241
- name: Download pecos-rslib wheel
271242
uses: actions/download-artifact@v4
272243
with:
273244
name: wheel-pecos-rslib-ubuntu-latest-x86_64-py${{ matrix.python-version }}
274245
path: ./pecos-rslib-wheel
275246

276-
- name: Setup environment and install dependencies
247+
- name: Install pecos-rslib
248+
run: pip install ./pecos-rslib-wheel/*.whl
249+
250+
- name: Install build dependencies
277251
run: |
278-
uv pip install --system ./pecos-rslib-wheel/*.whl build
252+
python -m pip install --upgrade pip
253+
pip install build
279254
280255
- name: Build quantum-pecos wheel
281256
run: |
@@ -284,9 +259,8 @@ jobs:
284259
285260
- name: Test quantum-pecos wheel
286261
run: |
287-
uv sync # This will use the workspace config correctly
288-
uv pip install python/quantum-pecos/dist/*.whl
289-
uv run python -c 'import pecos; print(pecos.__version__)'
262+
pip install python/quantum-pecos/dist/*.whl
263+
python -c 'import pecos; print(pecos.__version__)'
290264
291265
- name: Upload quantum-pecos wheel
292266
uses: actions/upload-artifact@v4

.github/workflows/rust-test.yml

Lines changed: 100 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Rust test / linting
22

3+
env:
4+
TRIGGER_ON_PR_PUSH: true # Set to true to enable triggers on PR pushes
5+
6+
RUSTFLAGS: -C debuginfo=0
7+
RUST_BACKTRACE: 1
8+
39
on:
410
push:
511
branches: [ "master", "development" ]
@@ -22,10 +28,6 @@ concurrency:
2228
group: ${{ github.workflow }}-${{ github.ref }}
2329
cancel-in-progress: true
2430

25-
env:
26-
RUSTFLAGS: -C debuginfo=0
27-
RUST_BACKTRACE: 1
28-
2931
jobs:
3032
rust-lint:
3133
runs-on: ubuntu-latest
@@ -83,6 +85,15 @@ jobs:
8385
- uses: actions/checkout@v4
8486

8587
- name: Install Rust (for local testing)
88+
if: matrix.os == 'windows-latest'
89+
run: |
90+
curl -sSf -o rustup-init.exe https://win.rustup.rs
91+
./rustup-init.exe -y --default-toolchain stable --profile minimal
92+
echo "$HOME\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
93+
$env:Path += ";$HOME\.cargo\bin"
94+
95+
- name: Install Rust (for local testing)
96+
if: matrix.os != 'windows-latest'
8697
run: |
8798
curl https://sh.rustup.rs -sSf | sh -s -- -y
8899
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
@@ -114,16 +125,95 @@ jobs:
114125
which llc
115126
116127
- name: Install LLVM Tools (Windows)
128+
if: matrix.os == 'windows-latest'
129+
uses: KyleMayes/install-llvm-action@v2
130+
with:
131+
version: "14.0"
132+
directory: ${{ runner.temp }}/llvm
133+
env: true
134+
135+
- name: Setup LLVM Path (Windows)
117136
if: matrix.os == 'windows-latest'
118137
run: |
119-
choco install llvm
120-
echo "C:/Program Files/LLVM/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
121-
# Verify installation
122-
Get-Command llc.exe -ErrorAction SilentlyContinue | Out-String
123-
& "C:/Program Files/LLVM/bin/llc.exe" --version
138+
Write-Host "Setting up LLVM in PATH..."
139+
140+
# Display LLVM_PATH environment variable set by the action
141+
Write-Host "LLVM_PATH environment variable: $env:LLVM_PATH"
142+
143+
# Add LLVM bin directory to PATH for this and subsequent steps
144+
$llvmBinDir = Join-Path -Path $env:LLVM_PATH -ChildPath "bin"
145+
146+
# Verify the directory exists
147+
if (Test-Path -Path $llvmBinDir) {
148+
Write-Host "LLVM bin directory exists at $llvmBinDir"
149+
# List contents to verify what's available
150+
Write-Host "LLVM bin directory contents:"
151+
Get-ChildItem -Path $llvmBinDir | Select-Object -First 10 | ForEach-Object {
152+
Write-Host " $($_.Name)"
153+
}
154+
155+
# Add to PATH
156+
echo "$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
157+
$env:PATH = "$llvmBinDir;$env:PATH"
158+
159+
# Verify llc is available
160+
$llcPath = Join-Path -Path $llvmBinDir -ChildPath "llc.exe"
161+
if (Test-Path -Path $llcPath) {
162+
Write-Host "Found llc.exe at $llcPath"
163+
Write-Host "Testing llc.exe:"
164+
& "$llcPath" --version
165+
} else {
166+
Write-Host "WARNING: llc.exe not found at $llcPath"
167+
# Display all exe files to help diagnose what might be available
168+
Write-Host "Available executables in bin directory:"
169+
Get-ChildItem -Path $llvmBinDir -Filter "*.exe" | ForEach-Object {
170+
Write-Host " $($_.Name)"
171+
}
172+
}
173+
} else {
174+
Write-Host "ERROR: LLVM bin directory does not exist at $llvmBinDir"
175+
Write-Host "LLVM_PATH contents:"
176+
Get-ChildItem -Path $env:LLVM_PATH | ForEach-Object {
177+
Write-Host " $($_.Name)"
178+
}
179+
exit 1
180+
}
181+
182+
- name: Verify LLVM PATH (Windows)
183+
if: matrix.os == 'windows-latest'
184+
run: |
185+
Write-Host "PATH environment variable:"
186+
$env:PATH -split ';' | ForEach-Object { Write-Host " $_" }
187+
188+
Write-Host "Checking for llc command:"
189+
try {
190+
$llcCommand = Get-Command llc -ErrorAction Stop
191+
Write-Host "Found llc at location $($llcCommand.Source)"
192+
& $llcCommand.Source --version
193+
} catch {
194+
Write-Host "llc command not found in PATH. This may cause tests to fail."
195+
196+
# Look for llc.exe in LLVM_PATH
197+
if ($env:LLVM_PATH) {
198+
$llcPath = Join-Path -Path $env:LLVM_PATH -ChildPath "bin\llc.exe"
199+
if (Test-Path -Path $llcPath) {
200+
Write-Host "Found llc.exe at $llcPath, but it's not in PATH. Adding it now."
201+
$llvmBinDir = Join-Path -Path $env:LLVM_PATH -ChildPath "bin"
202+
$env:PATH = "$llvmBinDir;$env:PATH"
203+
echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
204+
}
205+
}
206+
}
124207
125208
- name: Compile tests
126209
run: cargo test --no-run
127210

128-
- name: Run tests
211+
- name: Run tests (Linux/macOS)
212+
if: matrix.os != 'windows-latest'
129213
run: cargo test
214+
215+
- name: Run tests (Windows)
216+
if: matrix.os == 'windows-latest'
217+
run: |
218+
# Run all tests with our trait re-export fix
219+
cargo test --workspace --exclude pecos-rslib

.github/workflows/rust-version-consistency.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Rust Version Consistency Check
22

3+
# bump
4+
35
on:
46
push:
57
paths:

0 commit comments

Comments
 (0)