Skip to content

Commit db47b5c

Browse files
committed
fix: corrections after review
1 parent f782c5f commit db47b5c

File tree

8 files changed

+30
-31
lines changed

8 files changed

+30
-31
lines changed

.github/workflows/self-hosted.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ jobs:
4444
cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON
4545
4646
- name: Build library sources
47-
working-directory: ${{ env.build_dir }}
4847
run: |
49-
cmake --build . --target all --verbose -j `nproc`
48+
cmake --build ${{ env.build_dir }} --target all --verbose -j `nproc`
5049
5150
test:
5251
name: Test GPU ${{ matrix.gpu }} CUDA ${{ matrix.cuda }}
@@ -66,7 +65,8 @@ jobs:
6665
- name: Run unit-tests
6766
working-directory: ${{ env.build_dir }}
6867
run: |
69-
source scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
68+
bash scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
69+
shell: bash
7070

7171
- name: Upload unit tests resutls
7272
uses: actions/upload-artifact@v4
@@ -77,14 +77,13 @@ jobs:
7777
- name: Check for unit tests results
7878
working-directory: ${{ env.build_dir }}
7979
run: |
80-
if grep -q "FAILED" ${{ env.unit-test-file }}; then
81-
exit 1
82-
fi
80+
! grep -q "FAILED" ${{ env.unit-test-file }}
8381
8482
- name: Run regression-tests
8583
working-directory: ${{ env.build_dir }}/python
8684
run: |
87-
source run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}
85+
bash run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}
86+
shell: bash
8887

8988
- name: Upload regression tests resutls
9089
uses: actions/upload-artifact@v4
@@ -95,9 +94,7 @@ jobs:
9594
- name: Check for regression tests results
9695
working-directory: ${{ env.build_dir }}/python
9796
run: |
98-
if grep -q "FAILED" ${{ env.regression-test-file }}; then
99-
exit 1
100-
fi
97+
! grep -q "FAILED" ${{ env.regression-test-file }}
10198
10299
clean:
103100
name: Cleanup workspace

.github/workflows/ubuntu.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ jobs:
3333
cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON -DCUBOOL_WITH_CUDA=OFF
3434
3535
- name: Build library sources
36-
working-directory: ${{ env.build_dir }}
3736
run: |
38-
cmake --build . --target all --verbose -j `nproc`
37+
cmake --build ${{ env.build_dir }} --target all --verbose -j `nproc`
3938
4039
- name: Prepare upload binary
4140
run: |
@@ -74,7 +73,8 @@ jobs:
7473
- name: Run unit-tests
7574
working-directory: ${{ env.build_dir }}
7675
run: |
77-
source scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
76+
bash scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
77+
shell: bash
7878

7979
- name: Upload unit tests resutls
8080
uses: actions/upload-artifact@v4
@@ -85,14 +85,13 @@ jobs:
8585
- name: Check for unit tests results
8686
working-directory: ${{ env.build_dir }}
8787
run: |
88-
if grep -q "FAILED" ${{ env.unit-test-file }}; then
89-
exit 1
90-
fi
88+
! grep -q "FAILED" ${{ env.unit-test-file }}
9189
9290
- name: Run regression-tests
9391
working-directory: ${{ env.build_dir }}/python
9492
run: |
95-
source run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}
93+
bash run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}
94+
shell: bash
9695

9796
- name: Upload regression tests resutls
9897
uses: actions/upload-artifact@v4
@@ -103,6 +102,4 @@ jobs:
103102
- name: Check for regression tests results
104103
working-directory: ${{ env.build_dir }}/python
105104
run: |
106-
if grep -q "FAILED" ${{ env.regression-test-file }}; then
107-
exit 1
108-
fi
105+
! grep -q "FAILED" ${{ env.regression-test-file }}

python/publish_pypi.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
#!/bin/bash
12
python3 setup.py sdist bdist_wheel
23
twine upload --verbose dist/*

python/publish_t_pypi.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
#!/bin/bash
12
python3 setup.py sdist bdist_wheel
23
twine upload --verbose --repository testpypi dist/*

python/run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
export PYTHONPATH="`pwd`:$PYTHONPATH"
23
cd tests
34
python3 -m unittest discover -v

scripts/install_cuda_ubuntu.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# Original script from https://github.com/ptheywood/cuda-cmake-github-actions
23

34
CUDA_PACKAGES_IN=(
@@ -17,7 +18,7 @@ function version_ge() {
1718
# returns 0 (true) if a > b
1819
function version_gt() {
1920
[ "$#" != "2" ] && echo "${FUNCNAME[0]} requires exactly 2 arguments." && exit 1
20-
[ "$1" = "$2" ] && return 1 || version_ge $1 $2
21+
[ "$1" = "$2" ] && return 1 || version_ge "$1" "$2"
2122
}
2223
# returns 0 (true) if a <= b
2324
function version_le() {
@@ -27,13 +28,13 @@ function version_le() {
2728
# returns 0 (true) if a < b
2829
function version_lt() {
2930
[ "$#" != "2" ] && echo "${FUNCNAME[0]} requires exactly 2 arguments." && exit 1
30-
[ "$1" = "$2" ] && return 1 || version_le $1 $2
31+
[ "$1" = "$2" ] && return 1 || version_le "$1" "$2"
3132
}
3233

3334
## Select CUDA version
3435

3536
# Get the cuda version from the environment as $cuda.
36-
CUDA_VERSION_MAJOR_MINOR=${cuda}
37+
CUDA_VERSION_MAJOR_MINOR=${cuda:=12.8}
3738

3839
# Split the version.
3940
# We (might/probably) don't know PATCH at this point - it depends which version gets installed.
@@ -60,7 +61,7 @@ if [ -z "${CUDA_MINOR}" ] ; then
6061
exit 1
6162
fi
6263
# If we don't know the Ubuntu version, error.
63-
if [ -z ${UBUNTU_VERSION} ]; then
64+
if [ -z "${UBUNTU_VERSION}" ]; then
6465
echo "Error: Unknown Ubuntu version. Aborting."
6566
exit 1
6667
fi
@@ -112,15 +113,15 @@ echo "KEYRING_PACKAGE_URL ${KEYRING_PACKAGE_URL}"
112113

113114
# Detect if the script is being run as root, storing true/false in is_root.
114115
is_root=false
115-
if (( $EUID == 0)); then
116+
if (( EUID == 0)); then
116117
is_root=true
117118
fi
118119
# Find if sudo is available
119120
has_sudo=false
120121
if command -v sudo &> /dev/null ; then
121122
has_sudo=true
122123
fi
123-
# Decide if we can proceed or not (root or sudo is required) and if so store whether sudo should be used or not.
124+
# Decide if we can proceed or not (root or sudo is required) and if so store whether sudo should be used or not.
124125
if [ "$is_root" = false ] && [ "$has_sudo" = false ]; then
125126
echo "Root or sudo is required. Aborting."
126127
exit 1
@@ -136,16 +137,15 @@ $USE_SUDO apt-get update
136137

137138
## Install
138139
echo "Adding CUDA Repository"
139-
wget ${PIN_URL}
140-
$USE_SUDO mv ${PIN_FILENAME} /etc/apt/preferences.d/cuda-repository-pin-600
141-
wget ${KEYRING_PACKAGE_URL} && ${USE_SUDO} dpkg -i ${KERYRING_PACKAGE_FILENAME} && rm ${KERYRING_PACKAGE_FILENAME}
140+
wget "${PIN_URL}"
141+
$USE_SUDO mv "${PIN_FILENAME}" /etc/apt/preferences.d/cuda-repository-pin-600
142+
wget "${KEYRING_PACKAGE_URL}" && ${USE_SUDO} dpkg -i ${KERYRING_PACKAGE_FILENAME} && rm ${KERYRING_PACKAGE_FILENAME}
142143
$USE_SUDO add-apt-repository "deb ${REPO_URL} /"
143144
$USE_SUDO apt-get update
144145

145146
echo "Installing CUDA packages ${CUDA_PACKAGES}"
146-
$USE_SUDO apt-get -y install ${CUDA_PACKAGES}
147147

148-
if [[ $? -ne 0 ]]; then
148+
if ! $USE_SUDO apt-get -y install "${CUDA_PACKAGES}"; then
149149
echo "CUDA Installation Error."
150150
exit 1
151151
fi

scripts/run_tests_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# Runs all tests executables
23
# Invoke this script within build directory
34
./cubool/tests/test_library_api

scripts/run_tests_fallback.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# Runs all tests executables
23
# Invoke this script within build directory
34
./cubool/tests/test_library_api

0 commit comments

Comments
 (0)