@@ -29,12 +29,12 @@ jobs:
2929 runs-on : ubuntu-latest
3030 timeout-minutes : 5
3131 steps :
32- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
32+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
3333 - name : Set up Python 3.11
34- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # ratchet:actions/setup-python@v5
34+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
3535 with :
3636 python-version : 3.11
37- - uses : pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # ratchet: pre-commit/action@ v3.0.1
37+ - uses : pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
3838
3939 build :
4040 name : " build ${{ matrix.name-prefix }} (py ${{ matrix.python-version }} on ${{ matrix.os }}, x64=${{ matrix.enable-x64}})"
5757 prng-upgrade : 0
5858 num_generated_cases : 1
5959 steps :
60- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
60+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
6161 - name : Set up Python ${{ matrix.python-version }}
62- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # ratchet:actions/setup-python@v5
62+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
6363 with :
6464 python-version : ${{ matrix.python-version }}
6565 - name : Get pip cache dir
6868 python -m pip install --upgrade pip wheel
6969 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
7070 - name : pip cache
71- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # ratchet: actions/cache@v4
71+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
7272 with :
7373 path : ${{ steps.pip-cache.outputs.dir }}
7474 key : ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -104,9 +104,9 @@ jobs:
104104 matrix :
105105 python-version : ['3.10']
106106 steps :
107- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
107+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
108108 - name : Set up Python ${{ matrix.python-version }}
109- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # ratchet:actions/setup-python@v5
109+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
110110 with :
111111 python-version : ${{ matrix.python-version }}
112112 - name : Get pip cache dir
@@ -115,7 +115,7 @@ jobs:
115115 python -m pip install --upgrade pip wheel
116116 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
117117 - name : pip cache
118- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # ratchet: actions/cache@v4
118+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
119119 with :
120120 path : ${{ steps.pip-cache.outputs.dir }}
121121 key : ${{ runner.os }}-pip-docs-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -141,9 +141,9 @@ jobs:
141141 matrix :
142142 python-version : ['3.10']
143143 steps :
144- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
144+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
145145 - name : Set up Python ${{ matrix.python-version }}
146- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # ratchet:actions/setup-python@v5
146+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
147147 with :
148148 python-version : ${{ matrix.python-version }}
149149 - name : Get pip cache dir
@@ -152,7 +152,7 @@ jobs:
152152 python -m pip install --upgrade pip wheel
153153 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
154154 - name : pip cache
155- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # ratchet: actions/cache@v4
155+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
156156 with :
157157 path : ${{ steps.pip-cache.outputs.dir }}
158158 key : ${{ runner.os }}-pip-docs-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -177,9 +177,9 @@ jobs:
177177 enable-x64 : 0
178178 num_generated_cases : 10
179179 steps :
180- - uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
180+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
181181 - name : Set up Python ${{ matrix.python-version }}
182- uses : actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # ratchet:actions/setup-python@v5
182+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
183183 with :
184184 python-version : ${{ matrix.python-version }}
185185 - name : Get pip cache dir
@@ -188,7 +188,7 @@ jobs:
188188 python -m pip install --upgrade pip wheel
189189 echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
190190 - name : pip cache
191- uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # ratchet: actions/cache@v4
191+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
192192 with :
193193 path : ${{ steps.pip-cache.outputs.dir }}
194194 key : ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt') }}
@@ -210,4 +210,37 @@ jobs:
210210 echo "JAX_ENABLE_CHECKS=$JAX_ENABLE_CHECKS"
211211 echo "JAX_SKIP_SLOW_TESTS=$JAX_SKIP_SLOW_TESTS"
212212 pytest -n auto --tb=short --maxfail=20 jax/experimental/jax2tf/tests/jax2tf_test.py
213-
213+
214+ ffi :
215+ name : FFI example
216+ runs-on : ubuntu-latest
217+ timeout-minutes : 5
218+ steps :
219+ - uses : actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
220+ - name : Set up Python 3.11
221+ uses : actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
222+ with :
223+ python-version : 3.11
224+ - name : Get pip cache dir
225+ id : pip-cache
226+ run : |
227+ python -m pip install --upgrade pip wheel
228+ echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
229+ - name : pip cache
230+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
231+ with :
232+ path : ${{ steps.pip-cache.outputs.dir }}
233+ key : ${{ runner.os }}-pip-ffi-examples-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt', 'examples/**/pyproject.toml') }}
234+ - name : Install JAX
235+ run : pip install .
236+ - name : Build and install example project
237+ run : python -m pip install -v ./examples/ffi[test]
238+ env :
239+ # We test building using GCC instead of clang. All other JAX builds use
240+ # clang, but it is useful to make sure that FFI users can compile using
241+ # a different toolchain. GCC is the default compiler on the
242+ # 'ubuntu-latest' runner, but we still set this explicitly just to be
243+ # clear.
244+ CMAKE_ARGS : -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
245+ - name : Run tests
246+ run : python -m pytest examples/ffi/tests
0 commit comments