Repository navigation
152 lines (128 loc) · 4.44 KB
/
Copy pathci.yml
File metadata and controls
152 lines (128 loc) · 4.44 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: CI
on:
push:
branches: [master, main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.os }}, Ruby ${{ matrix.ruby }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
ruby: "3.2"
- os: ubuntu-24.04
ruby: "3.3"
- os: ubuntu-24.04
ruby: "3.4"
- os: ubuntu-24.04-arm
ruby: "3.4"
- os: macos-15
ruby: "3.2"
- os: macos-15
ruby: "3.4"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "test/fixtures/pyproject.toml"
- name: Cache ExecuTorch C++ SDK
uses: actions/cache@v4
with:
path: ~/.cache/executorch-ruby
key: sdk-${{ matrix.os }}-${{ runner.arch }}-${{ hashFiles('.executorch-version', 'lib/executorch/sdk.rb') }}
- name: Fetch ExecuTorch SDK & compile native extension
run: |
bundle exec rake sdk:fetch
bundle exec rake compile
- name: Export deterministic .pte / .ptd test fixtures
run: |
uv run --project test/fixtures python test/fixtures/export_fixtures.py --out test/fixtures/models
- name: Run full test suite (zero skips allowed)
run: |
set -o pipefail
bundle exec rake test TESTOPTS="-v" | tee test_output.txt
grep -qE "0 failures, 0 errors, 0 skips" test_output.txt
sanitizers:
name: ASan + UBSan (ubuntu-24.04, Ruby 3.4)
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "test/fixtures/pyproject.toml"
- name: Cache ExecuTorch C++ SDK
uses: actions/cache@v4
with:
path: ~/.cache/executorch-ruby
key: sdk-ubuntu-24.04-${{ runner.arch }}-${{ hashFiles('.executorch-version', 'lib/executorch/sdk.rb') }}
- name: Compile with ASan + UBSan
env:
EXECUTORCH_SANITIZE: "1"
run: |
bundle exec rake sdk:fetch
bundle exec rake compile
- name: Export fixtures
run: |
uv run --project test/fixtures python test/fixtures/export_fixtures.py --out test/fixtures/models
- name: Run tests under ASan + UBSan
run: |
ASAN_LIB=$(g++ -print-file-name=libasan.so)
UBSAN_LIB=$(g++ -print-file-name=libubsan.so)
LD_PRELOAD="${ASAN_LIB}:${UBSAN_LIB}" \
ASAN_OPTIONS="detect_leaks=0:use_sigaltstack=0:halt_on_error=1" \
UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" \
bundle exec rake test TESTOPTS="-v"
package-smoke:
name: Platform Gem Smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Build platform fat gem & source gem
run: |
bundle exec rake sdk:fetch
bundle exec rake package_platform
gem build executorch.gemspec -o pkg/executorch-source.gem
- name: Smoke-test isolated platform gem install (no SDK cache required)
run: |
rm -rf ~/.cache/executorch-ruby
GEM_HOME=$(mktemp -d)
export GEM_HOME
export PATH="$GEM_HOME/bin:$PATH"
gem install --local --no-document pkg/executorch-*-*.gem
ruby -rexecutorch -e '
raise "missing XNNPACK" unless Executorch.backends.include?("XnnpackBackend")
t = Executorch::Tensor.new([[1.0, 2.0], [3.0, 4.0]])
raise "bad roundtrip" unless t.to_a == [[1.0, 2.0], [3.0, 4.0]]
puts "OK: #{Executorch::VERSION} / SDK #{Executorch.executorch_version} / #{Executorch.backends.inspect}"
'