-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 1.9 KB
/
run_tests.yaml
File metadata and controls
77 lines (66 loc) · 1.9 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
name: ArgMojo Unit Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
testing-argmojo:
name: Test with ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-latest"]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install pixi
run: |
curl -fsSL https://pixi.sh/install.sh | sh
- name: Add pixi to PATH
run: |
echo "PIXI_HOME=$HOME/.pixi" >> $GITHUB_ENV
echo "$HOME/.pixi/bin" >> $GITHUB_PATH
- name: Pixi install
run: |
pixi install
- name: Build package (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== mojo package attempt $attempt ==="
if pixi run package; then
echo "=== package succeeded on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== package failed after 3 attempts ==="
exit 1
fi
echo "=== package crashed, retrying in 5s... ==="
sleep 5
done
- name: Run tests (with retry for Mojo compiler intermittent crashes)
run: |
for attempt in 1 2 3; do
echo "=== test attempt $attempt ==="
if pixi run test; then
echo "=== tests passed on attempt $attempt ==="
break
fi
if [ "$attempt" -eq 3 ]; then
echo "=== tests failed after 3 attempts ==="
exit 1
fi
echo "=== test run crashed, retrying in 5s... ==="
sleep 5
done