Skip to content

Commit 9124e8b

Browse files
committed
ci: build Cython/Rust extensions before running tests
Install C build tools and Rust toolchain in CI (the test container purges them to reduce image size), then run setup.py build_ext --inplace before pytest so test_cython_matches_python_fallback and test_rust_matches_python_fallback do not fail on ImportError.
1 parent 58f6d4e commit 9124e8b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/build-and-test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ jobs:
1515
- name: Install Project Dependencies
1616
run: pip3 install --upgrade pip && PYTHONPATH=/code/pyquarkchain pip3 install -e .
1717

18+
- name: Install C build tools
19+
run: apt-get update && apt-get install -y build-essential gcc g++ make
20+
21+
- name: Install Rust toolchain
22+
run: |
23+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal
24+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
25+
26+
- name: Build Cython/Rust extensions
27+
run: python3 setup.py build_ext --inplace
28+
1829
- name: Run py.test tests excluding integration test
1930
run: |
2031
cd qkchash && make clean && make && cd -
@@ -55,6 +66,17 @@ jobs:
5566
- name: Install Project Dependencies
5667
run: pip3 install --upgrade pip && PYTHONPATH=/code/pyquarkchain pip3 install -e .
5768

69+
- name: Install C build tools
70+
run: apt-get update && apt-get install -y build-essential gcc g++ make
71+
72+
- name: Install Rust toolchain
73+
run: |
74+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal
75+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
76+
77+
- name: Build Cython/Rust extensions
78+
run: python3 setup.py build_ext --inplace
79+
5880
- name: Run py.test tests only on integration test
5981
run: |
6082
cd qkchash && make clean && make && cd -

0 commit comments

Comments
 (0)