Skip to content

Commit 1f5811f

Browse files
Merge branch 'main' into feat/run-executable-flag
2 parents 055c570 + 061ec00 commit 1f5811f

File tree

628 files changed

+90113
-6353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

628 files changed

+90113
-6353
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Backends - Python Bindings
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- crates/pixi-build-backend/**
8+
- Cargo.*
9+
- pixi-build-backends/py-pixi-build-backend/**
10+
- .github/workflows/backends-python-bindings.yml
11+
pull_request:
12+
paths:
13+
- crates/pixi-build-backend/**
14+
- Cargo.*
15+
- pixi-build-backends/py-pixi-build-backend/**
16+
- .github/workflows/backends-python-bindings.yml
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
env:
27+
PYTHONIOENCODING: utf-8
28+
29+
jobs:
30+
format_lint_test:
31+
name: Test the Python bindings
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
submodules: recursive
37+
persist-credentials: false
38+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
39+
with:
40+
manifest-path: pixi-build-backends/py-pixi-build-backend/pixi.toml
41+
environments: ci
42+
- name: Run clippy
43+
run: |
44+
cd pixi-build-backends/py-pixi-build-backend
45+
pixi run -e ci lint
46+
- name: Run tests
47+
run: |
48+
cd pixi-build-backends/py-pixi-build-backend
49+
pixi run -e ci test --color=yes
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: "Backends - Conda Packages"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
push_to_channel:
7+
description: "Push packages to conda channel after build"
8+
required: false
9+
default: true
10+
type: boolean
11+
package_name:
12+
description: "Build specific package only (optional)"
13+
required: false
14+
type: string
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref_name }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
generate-matrix:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
matrix: ${{ steps.set_version.outputs.matrix }}
28+
steps:
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30+
with:
31+
persist-credentials: false
32+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
33+
with:
34+
environments: backends-release
35+
- name: Extract versions
36+
id: set_version
37+
run: |
38+
# extract names and versions from cargo metadata
39+
# and generate a matrix entries for the build job
40+
echo "Package name input: '${GITHUB_EVENT_INPUTS_PACKAGE_NAME}'"
41+
if [ -n "${GITHUB_EVENT_INPUTS_PACKAGE_NAME}" ]; then
42+
echo "Building specific package: ${GITHUB_EVENT_INPUTS_PACKAGE_NAME}"
43+
MATRIX_JSON=$(pixi run -e backends-release generate-matrix --package "${GITHUB_EVENT_INPUTS_PACKAGE_NAME}")
44+
else
45+
echo "Building all packages"
46+
MATRIX_JSON=$(pixi run -e backends-release generate-matrix)
47+
fi
48+
49+
echo "Generated matrix: $MATRIX_JSON"
50+
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
51+
env:
52+
GITHUB_EVENT_INPUTS_PACKAGE_NAME: ${{ github.event.inputs.package_name }}
53+
54+
build:
55+
needs: generate-matrix
56+
permissions:
57+
id-token: write
58+
attestations: write
59+
contents: read
60+
env:
61+
REPO_NAME: "prefix-dev/pixi"
62+
strategy:
63+
matrix:
64+
bins: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
65+
fail-fast: false
66+
runs-on: ${{ matrix.bins.os }}
67+
steps:
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
69+
with:
70+
persist-credentials: false
71+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
72+
with:
73+
environments: backends-release
74+
- name: Enable long paths (Windows)
75+
if: ${{ matrix.bins.os == 'windows-latest' }}
76+
run: |
77+
git config --global core.longpaths true
78+
shell: bash
79+
- name: Set environment variable for recipe version
80+
shell: bash
81+
run: |
82+
echo "${{ matrix.bins.env_name }}=${{ matrix.bins.version }}" >> $GITHUB_ENV
83+
- name: Build ${{ matrix.bins.bin }}
84+
shell: bash
85+
env:
86+
RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: "true"
87+
RATTLER_BUILD_COLOR: "always"
88+
run: |
89+
pixi run -e backends-release build-recipe-ci $RUNNER_TEMP pixi-build-backends/recipe/${{ matrix.bins.bin }}/recipe.yaml ${{ matrix.bins.target }}
90+
91+
- uses: actions/attest@daf44fb950173508f38bd2406030372c1d1162b1 # v3.0.0
92+
id: attest
93+
with:
94+
subject-path: "${{ runner.temp }}/**/*.conda"
95+
predicate-type: "https://schemas.conda.org/attestations-publish-1.schema.json"
96+
predicate: "{\"targetChannel\": \"https://prefix.dev/pixi-build-backends\"}"
97+
98+
- name: Generate attestation for conda package
99+
shell: bash
100+
run: |
101+
# Convert Windows paths to Unix-style for bash compatibility
102+
RUNNER_TEMP_UNIX="${{ runner.temp }}"
103+
RUNNER_TEMP_UNIX="${RUNNER_TEMP_UNIX//\\//}"
104+
BUNDLE_PATH_UNIX="${STEPS_ATTEST_OUTPUTS_BUNDLE_PATH//\\//}"
105+
106+
# Find the actual conda package file (search recursively)
107+
CONDA_PACKAGE=$(find "$RUNNER_TEMP_UNIX" -name "*.conda" -type f | head -1)
108+
if [ -n "$CONDA_PACKAGE" ]; then
109+
# Extract just the filename without path
110+
PACKAGE_NAME=$(basename "$CONDA_PACKAGE")
111+
# Create signature filename by replacing .conda with .sig
112+
SIG_NAME="${PACKAGE_NAME%.conda}.sig"
113+
# Get the directory where the conda package is located
114+
PACKAGE_DIR=$(dirname "$CONDA_PACKAGE")
115+
# Move the attestation bundle to the same directory as the conda package
116+
mv "$BUNDLE_PATH_UNIX" "$PACKAGE_DIR/$SIG_NAME"
117+
echo "Created attestation: $PACKAGE_DIR/$SIG_NAME"
118+
else
119+
echo "Error: No conda package found in $RUNNER_TEMP_UNIX"
120+
exit 1
121+
fi
122+
env:
123+
STEPS_ATTEST_OUTPUTS_BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path }}
124+
125+
- name: Upload build artifacts
126+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
127+
with:
128+
name: conda-packages-${{ matrix.bins.bin }}-${{ matrix.bins.target }}
129+
path: |
130+
${{ runner.temp }}/**/*.conda
131+
${{ runner.temp }}/**/*.sig
132+
133+
- name: Kill any lingering processes (Windows)
134+
if: runner.os == 'Windows'
135+
shell: powershell
136+
run: |
137+
# Kill any Python processes
138+
Get-Process python* -ErrorAction SilentlyContinue | Stop-Process -Force
139+
140+
# Kill any processes from the pixi environment
141+
$pixiPath = "${{ github.workspace }}\.pixi\envs\backends-release\bin"
142+
Get-Process | Where-Object { $_.Path -like "$pixiPath*" } | Stop-Process -Force
143+
144+
# Wait a moment for handles to be released
145+
Start-Sleep -Seconds 2
146+
147+
aggregate:
148+
needs: build
149+
runs-on: ubuntu-latest
150+
strategy:
151+
matrix:
152+
target: [linux-64, linux-aarch64, linux-ppc64le, win-64, osx-64, osx-arm64]
153+
steps:
154+
- name: Download conda package artifacts for ${{ matrix.target }}
155+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
156+
with:
157+
pattern: conda-packages-*-${{ matrix.target }}
158+
path: conda-artifacts-${{ matrix.target }}
159+
merge-multiple: true
160+
- name: Upload aggregated conda packages for ${{ matrix.target }}
161+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
162+
with:
163+
name: conda-packages-${{ matrix.target }}
164+
path: conda-artifacts-${{ matrix.target }}/**/*.conda
165+
166+
upload:
167+
needs: aggregate
168+
runs-on: ubuntu-latest
169+
if: ${{ github.event.inputs.push_to_channel == 'true' && github.repository == 'prefix-dev/pixi' }}
170+
steps:
171+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
172+
with:
173+
persist-credentials: false
174+
- name: Download all conda packages
175+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
176+
with:
177+
pattern: conda-packages-*
178+
path: conda-packages
179+
merge-multiple: true
180+
run-id: ${{ github.run_id }}
181+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
182+
with:
183+
environments: backends-release
184+
- name: Upload packages
185+
shell: bash
186+
run: |
187+
for file in conda-packages/**/*.conda; do
188+
echo "Uploading ${file}"
189+
# Find corresponding attestation file
190+
ATTESTATION_FILE="${file%.conda}.sig"
191+
if [ -f "$ATTESTATION_FILE" ]; then
192+
echo "Found attestation: $ATTESTATION_FILE"
193+
pixi run -e backends-release rattler-build upload prefix -c pixi-build-backends "$file" --attestation "$ATTESTATION_FILE"
194+
else
195+
echo "Warning: No attestation found for $file"
196+
pixi run -e backends-release rattler-build upload prefix -c pixi-build-backends "$file"
197+
fi
198+
done

.github/workflows/backends-ros.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Backends - ROS
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
sha:
7+
type: string
8+
description: "The commit sha for artifact lookup"
9+
required: true
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
env:
20+
PYTHONIOENCODING: utf-8
21+
22+
jobs:
23+
test:
24+
name: Test the pixi-build-ros package
25+
runs-on: ubuntu-latest
26+
env:
27+
TARGET_RELEASE: target/pixi/release
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
persist-credentials: false
33+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
34+
with:
35+
manifest-path: pixi-build-backends/backends/pixi-build-ros/pixi.toml
36+
- name: Download pixi binary
37+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
38+
with:
39+
name: pixi-linux-x86_64-${{ inputs.sha }}
40+
path: ${{ env.TARGET_RELEASE }}
41+
- name: Add pixi binary to PATH
42+
run: |
43+
chmod a+x ${{ github.workspace }}/${{ env.TARGET_RELEASE }}/pixi
44+
echo "${{ github.workspace }}/${{ env.TARGET_RELEASE }}" >> $GITHUB_PATH
45+
- name: Lint
46+
run: |
47+
cd pixi-build-backends/backends/pixi-build-ros
48+
pixi run lint
49+
- name: Run tests
50+
run: |
51+
cd pixi-build-backends/backends/pixi-build-ros
52+
pixi run test-ci --color=yes
53+
54+
integration-test:
55+
name: Integration tests
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
include:
60+
- os: ubuntu-latest
61+
artifact: pixi-linux-x86_64
62+
- os: macos-14
63+
artifact: pixi-macos-aarch64
64+
- os: windows-latest
65+
artifact: pixi-windows-x86_64
66+
runs-on: ${{ matrix.os }}
67+
env:
68+
TARGET_RELEASE: target/pixi/release
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
persist-credentials: false
73+
74+
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
75+
with:
76+
manifest-path: pixi-build-backends/backends/pixi-build-ros/pixi.toml
77+
78+
- name: Download pixi binary
79+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
80+
with:
81+
name: ${{ matrix.artifact }}-${{ inputs.sha }}
82+
path: ${{ env.TARGET_RELEASE }}
83+
84+
- name: Add pixi binary to PATH (Unix)
85+
if: runner.os != 'Windows'
86+
run: |
87+
chmod a+x ${{ github.workspace }}/${{ env.TARGET_RELEASE }}/pixi
88+
echo "${{ github.workspace }}/${{ env.TARGET_RELEASE }}" >> $GITHUB_PATH
89+
90+
- name: Add pixi binary to PATH (Windows)
91+
if: runner.os == 'Windows'
92+
run: |
93+
echo "${{ github.workspace }}/${{ env.TARGET_RELEASE }}" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_PATH
94+
95+
- name: Verify pixi installation
96+
run: pixi info
97+
98+
- name: Build ROS backend channel
99+
working-directory: pixi-build-backends/backends/pixi-build-ros
100+
run: pixi run --locked create-channel
101+
102+
- name: Run ROS integration tests
103+
working-directory: pixi-build-backends/backends/pixi-build-ros
104+
run: pixi run --locked pytest tests/integration -v

0 commit comments

Comments
 (0)