Skip to content

Commit 94141a6

Browse files
committed
ci/feature: do not run c++ test for twice per OS
1 parent d8412d5 commit 94141a6

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ on:
1212
env:
1313
RUST_BACKTRACE: 1
1414
jobs:
15-
test:
16-
name: Test
15+
rust-tests:
16+
name: Rust tests
1717

1818
runs-on: ${{ matrix.os }}
1919
strategy:
@@ -65,7 +65,32 @@ jobs:
6565
run: |
6666
set -e
6767
cd $GITHUB_WORKSPACE
68-
python ci/build_and_run_tests.py
68+
python ci/build_and_run_tests.py --rust-only
69+
shell: bash
70+
cpp-tests:
71+
name: C++ tests
72+
runs-on: ${{ matrix.os }}
73+
strategy:
74+
fail-fast: false
75+
76+
matrix:
77+
os: [ubuntu-latest, macos-latest]
78+
steps:
79+
- uses: actions/checkout@v2
80+
with:
81+
submodules: 'recursive'
82+
- uses: actions/setup-python@v2
83+
with:
84+
python-version: '3.8.2'
85+
- uses: jwlawson/actions-setup-cmake@v1.0
86+
with:
87+
cmake-version: '3.9.6'
88+
github-api-token: ${{ secrets.GITHUB_TOKEN }}
89+
- name: Run tests
90+
run: |
91+
set -e
92+
cd $GITHUB_WORKSPACE
93+
python ci/build_and_run_tests.py --cpp-only
6994
shell: bash
7095
# Detect cases where documentation links don't resolve and such.
7196
doc:

ci/build_and_run_tests.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,17 @@ def build_and_test_rust_part(src_root: str):
4747
def main():
4848
ci_dir = Path(get_src_root_path(sys.argv[0]))
4949
src_root = ci_dir.parent
50-
build_and_test_cpp_part(src_root)
51-
build_and_test_rust_part(src_root)
50+
CPP_TESTS = "cpp"
51+
RUST_TESTS = "rust"
52+
tests = set([CPP_TESTS, RUST_TESTS])
53+
if len(sys.argv) >= 2 and sys.argv[1] == "--rust-only":
54+
tests = set([RUST_TESTS])
55+
if len(sys.argv) >= 2 and sys.argv[1] == "--cpp-only":
56+
tests = set([CPP_TESTS])
57+
if CPP_TESTS in tests:
58+
build_and_test_cpp_part(src_root)
59+
if RUST_TESTS in tests:
60+
build_and_test_rust_part(src_root)
5261

5362
if __name__ == "__main__":
5463
main()

0 commit comments

Comments
 (0)