Repository navigation
122 lines (115 loc) · 4.66 KB
/
Copy pathpackage-tests.yaml
File metadata and controls
122 lines (115 loc) · 4.66 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
118
119
120
121
122
# Nightly: the tests bundled in the published packages, run again against the newest
# conda-forge dependencies (tools/package_tests.py), to catch breakages that come from
# conda-forge rather than from RoboStack, e.g. ABI changes (RoboStack/ros-humble#274).
# Every package with a test file (shared/tests/, distros/<d>/tests/) is tested in its
# newest build, on each platform. The results are kept in one issue for all distributions
# ("Package tests", label package-tests, a section per distribution), closed when every
# test passes. Only the scheduled run on main and a full manual run on main update it.
name: package-tests
on:
schedule:
- cron: "31 2 * * *"
workflow_dispatch:
inputs:
distros:
description: Space-separated distributions to test (default all)
required: false
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: read
env:
PYTHONIOENCODING: utf-8
jobs:
plan:
runs-on: ubuntu-latest
outputs:
distros: ${{ steps.plan.outputs.distros }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Distributions
id: plan
env:
SELECTED: ${{ inputs.distros }}
run: |
distros=$(python3 -c 'import json, os, pathlib
selected = os.environ.get("SELECTED", "").split()
print(json.dumps(selected or sorted(p.parent.name for p in pathlib.Path("distros").glob("*/vinca.yaml"))))')
echo "distros=$distros" | tee -a "$GITHUB_OUTPUT"
test:
needs: plan
strategy:
fail-fast: false
matrix:
distro: ${{ fromJSON(needs.plan.outputs.distros) }}
target:
- { os: ubuntu-latest, platform: linux-64 }
- { os: ubuntu-24.04-arm, platform: linux-aarch64 }
- { os: macos-15-intel, platform: osx-64 }
- { os: macos-15, platform: osx-arm64 }
- { os: windows-2022, platform: win-64 }
name: ${{ matrix.distro }} ${{ matrix.target.platform }}
runs-on: ${{ matrix.target.os }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# git auto-maintenance can leave a lock file in the git clones pixi caches
# (e.g. vinca's), which breaks every later run restoring that cache
- name: Disable git auto-maintenance
run: git config --global maintenance.auto false && git config --global gc.auto 0 && git config --global core.longpaths true
- uses: prefix-dev/setup-pixi@v0.11.0
with:
locked: true # the lock file must match pixi.toml
pixi-version: v0.81.0
cache-write: false # saved from main only (pixi-cache.yaml)
- name: Test the published packages
# a failed test is reported in the issue (report job), not as a failed job
continue-on-error: true
shell: bash
env:
DISTRO: ${{ matrix.distro }}
PLATFORM: ${{ matrix.target.platform }}
# rattler-build test unpacks each test's packages and environment there: several
# GB for e.g. ros2-desktop-full, more than ubuntu-26.04's RAM-backed /tmp allows
# a user ("Disk quota exceeded"); the runner's temp directory is on its disk
TMPDIR: ${{ runner.temp }}
run: pixi run python tools/package_tests.py run --distro "$DISTRO" --platform "$PLATFORM" --results "results/$DISTRO-$PLATFORM.json"
- uses: actions/upload-artifact@v6
if: always()
with:
name: package-tests-${{ matrix.distro }}-${{ matrix.target.platform }}
path: results/
if-no-files-found: ignore
retention-days: 14
report:
needs: [plan, test]
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
issues: write # the "Package tests" issue
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@v0.11.0
with:
locked: true # the lock file must match pixi.toml
pixi-version: v0.81.0
cache-write: false # saved from main only (pixi-cache.yaml)
- uses: actions/download-artifact@v7
with:
pattern: package-tests-*
path: results/
- name: Update the issue
env:
GH_TOKEN: ${{ github.token }}
DISTROS: ${{ join(fromJSON(needs.plan.outputs.distros), ' ') }}
# a run of a branch, or of only some distributions, doesn't touch the issue
PUBLISH: ${{ github.ref == 'refs/heads/main' && !inputs.distros && '--publish' || '' }}
run: pixi run python tools/package_tests.py report results/ --distros "$DISTROS" $PUBLISH