Skip to content

Commit 1db799f

Browse files
committed
Fixing workflows
1 parent d5be159 commit 1db799f

File tree

20 files changed

+1530
-321
lines changed

20 files changed

+1530
-321
lines changed

.github/workflows/python-release.yml

Lines changed: 35 additions & 62 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
@@ -88,20 +81,21 @@ jobs:
8881
command: sdist
8982
args: --out dist
9083
working-directory: python/pecos-rslib
91-
manylinux: auto
9284

9385
- name: Restore README.md
9486
if: always()
9587
run: |
9688
if [ -f crates/pecos-python/README.md.bak ]; then
9789
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"
9893
fi
9994
100-
- name: Install and test pecos-rslib SDist
95+
- name: Test pecos-rslib SDist
10196
run: |
102-
uv sync --project .
103-
uv pip install --force-reinstall python/pecos-rslib/dist/*.tar.gz
104-
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__)'
10599
106100
- name: Upload pecos-rslib SDist
107101
uses: actions/upload-artifact@v4
@@ -136,20 +130,13 @@ jobs:
136130
with:
137131
python-version: ${{ matrix.python-version }}
138132

139-
- name: Install the latest version of uv
140-
uses: astral-sh/setup-uv@v4
141-
with:
142-
enable-cache: true
143-
ignore-nothing-to-cache: true
144-
cache-dependency-glob: |
145-
**/pyproject.toml
146-
**/requirements*.txt
147-
**/uv.lock
148-
149133
- name: Remove conflicting README.md
150134
run: |
151135
if [ -f crates/pecos-python/README.md ]; then
152136
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"
153140
fi
154141
155142
- name: Build wheel
@@ -166,14 +153,16 @@ jobs:
166153
run: |
167154
if [ -f crates/pecos-python/README.md.bak ]; then
168155
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"
169159
fi
170160
171161
- name: Test wheel
172162
if: ${{ !(matrix.architecture == 'x86_64' && matrix.os == 'macos-latest') && matrix.architecture != 'aarch64' }}
173163
run: |
174-
uv sync --project .
175-
uv pip install --force-reinstall python/pecos-rslib/dist/*.whl
176-
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__)'
177166
178167
- name: Upload wheel
179168
uses: actions/upload-artifact@v4
@@ -198,38 +187,29 @@ jobs:
198187
with:
199188
python-version: ${{ env.PYTHON_VERSION }}
200189

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

217-
- 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
218200
run: |
219-
uv sync --project .
220-
uv pip install ./pecos-rslib-wheel/*.whl
221-
uv pip install build
201+
python -m pip install --upgrade pip
202+
pip install build
222203
223204
- name: Build quantum-pecos SDist
224205
run: |
225206
cd python/quantum-pecos
226-
uv pip install --system build
227207
python -m build --sdist --outdir dist
228208
229209
- name: Test quantum-pecos SDist
230210
run: |
231-
uv pip install python/quantum-pecos/dist/*.tar.gz
232-
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__)'
233213
234214
- name: Upload quantum-pecos SDist
235215
uses: actions/upload-artifact@v4
@@ -253,30 +233,24 @@ jobs:
253233
with:
254234
ref: ${{ inputs.sha || github.sha }}
255235

256-
- name: Set up Python
236+
- name: Set up Python ${{ matrix.python-version }}
257237
uses: actions/setup-python@v5
258238
with:
259239
python-version: ${{ matrix.python-version }}
260240

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

277-
- 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
278251
run: |
279-
uv pip install --system ./pecos-rslib-wheel/*.whl build
252+
python -m pip install --upgrade pip
253+
pip install build
280254
281255
- name: Build quantum-pecos wheel
282256
run: |
@@ -285,9 +259,8 @@ jobs:
285259
286260
- name: Test quantum-pecos wheel
287261
run: |
288-
uv sync # This will use the workspace config correctly
289-
uv pip install python/quantum-pecos/dist/*.whl
290-
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__)'
291264
292265
- name: Upload quantum-pecos wheel
293266
uses: actions/upload-artifact@v4

.github/workflows/rust-test.yml

Lines changed: 81 additions & 64 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
@@ -123,80 +125,95 @@ jobs:
123125
which llc
124126
125127
- 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)
126136
if: matrix.os == 'windows-latest'
127137
run: |
128-
Write-Host "==== Installing LLVM with Chocolatey to specific location ===="
129-
# Create a dedicated LLVM installation directory
130-
mkdir -Force C:\llvm_install
138+
Write-Host "Setting up LLVM in PATH..."
131139
132-
# Install LLVM to the specific directory
133-
choco install llvm --params "/InstallDir:C:\llvm_install" --yes
140+
# Display LLVM_PATH environment variable set by the action
141+
Write-Host "LLVM_PATH environment variable: $env:LLVM_PATH"
134142
135-
Write-Host "==== Checking LLVM Installation ===="
136-
# Check if LLVM was installed to the expected location
137-
$expectedLlcPath = "C:\llvm_install\bin\llc.exe"
143+
# Add LLVM bin directory to PATH for this and subsequent steps
144+
$llvmBinDir = Join-Path -Path $env:LLVM_PATH -ChildPath "bin"
138145
139-
if (Test-Path $expectedLlcPath) {
140-
Write-Host "Found llc.exe at expected location: $expectedLlcPath"
141-
$llvmPath = $expectedLlcPath
142-
} else {
143-
# Fall back to checking common locations if the specified installation didn't work
144-
Write-Host "llc.exe not found at expected location, checking common locations..."
145-
146-
# Try to find llc in PATH first
147-
$llcCmd = Get-Command llc -ErrorAction SilentlyContinue
148-
if ($llcCmd) {
149-
$llvmPath = $llcCmd.Source
150-
Write-Host "Found llc.exe in PATH at: $llvmPath"
151-
} else {
152-
# Check other common locations
153-
$possiblePaths = @(
154-
"C:\Program Files\LLVM\bin\llc.exe",
155-
"C:\Program Files (x86)\LLVM\bin\llc.exe",
156-
"C:\ProgramData\chocolatey\bin\llc.exe",
157-
"C:\ProgramData\chocolatey\lib\llvm\tools\LLVM\bin\llc.exe"
158-
)
159-
160-
foreach ($path in $possiblePaths) {
161-
Write-Host "Checking $path..."
162-
if (Test-Path $path) {
163-
$llvmPath = $path
164-
Write-Host "Found llc.exe at: $path"
165-
break
166-
}
167-
}
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)"
168153
}
169154
170-
# If still not found, search Chocolatey directories as last resort
171-
if (-not $llvmPath) {
172-
Write-Host "Searching in Chocolatey directories..."
173-
$chocoResults = Get-ChildItem -Path "C:\ProgramData\chocolatey" -Filter "llc.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
155+
# Add to PATH
156+
echo "$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
157+
$env:PATH = "$llvmBinDir;$env:PATH"
174158
175-
if ($chocoResults) {
176-
$llvmPath = $chocoResults.FullName
177-
Write-Host "Found llc.exe at: $llvmPath"
178-
} else {
179-
throw "Could not locate llc.exe. LLVM installation may have failed."
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)"
180171
}
181172
}
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
182180
}
183181
184-
Write-Host "==== LLVM Configuration ===="
185-
$llvmBinDir = Split-Path -Parent $llvmPath
186-
Write-Host "LLVM bin directory: $llvmBinDir"
187-
Write-Host "Files in LLVM bin directory: $(Get-ChildItem -Path $llvmBinDir -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name)"
188-
189-
# Add LLVM bin to PATH
190-
Write-Host "Adding LLVM bin directory to PATH: $llvmBinDir"
191-
echo $llvmBinDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
192-
$env:Path += ";$llvmBinDir"
193-
194-
# Verify by running llc
195-
Write-Host "Running llc version check:"
196-
& $llvmPath --version
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+
}
197207
198208
- name: Compile tests
199209
run: cargo test --no-run
200210

201-
- name: Run tests
211+
- name: Run tests (Linux/macOS)
212+
if: matrix.os != 'windows-latest'
202213
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)