-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggestion: improve CI runtime (#199)
* Remove conda from ci * Install cuda with action; use CI runner compiler versions. TODO: ensure correct version of clang tools are used * Fix cuda install action version * Reduce size of cuda install as much as possible; set cuda version to 12.2 * Fix workflow syntax * Add required cuda subpackages * Move libcufft to other installer arg * Install dev versions of nvrtc and cufft * add cublas * Install precommit in CI * Temporarily force run all pre commit tools * Install cppcheck, run verison check * Don't let cppcheck complain about system includes it cannot find * Print more tool versions * Install cmake-{lint,format} in CI * Make sure versions are the same in CI and env; properly install cmakelang * Remove libcublas from CI; takes a while and seems like we don't actually need it * make cppcheck stop complain about unmatched suppression unreadVariable * Add tool names to version prints; revert to proper pre-commit run
- Loading branch information
Showing
3 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: pre-commit | ||
# conda cache setup based on https://github.com/epassaro/cache-conda-envs | ||
|
||
on: | ||
push: | ||
|
@@ -9,6 +8,15 @@ jobs: | |
linting: | ||
name: run | ||
runs-on: ubuntu-latest | ||
env: | ||
# set tools versions to latest supported by the CI runner, | ||
# ubuntu 22.04 at the time of writing | ||
# clang defaults to v14.0.0 | ||
gcc-version: "12" # = 12.1.0 | ||
# cuda version to install with separate action | ||
cuda-version: "12.2.0" | ||
# version for cmake-lint and cmake-format | ||
cmakelang-version: "0.6.13" | ||
steps: | ||
|
||
- name: Show git version | ||
|
@@ -44,27 +52,34 @@ jobs: | |
git checkout ${{ env.precommit_from_ref }} | ||
git checkout ${{ env.precommit_to_ref }} | ||
- name: Setup environment with Mamba | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- name: Install cuda | ||
uses: Jimver/[email protected] | ||
with: | ||
mamba-version: "*" | ||
channels: conda-forge | ||
activate-environment: recruit | ||
cuda: ${{ env.cuda-version }} | ||
method: "network" | ||
sub-packages: '["nvcc", "nvrtc-dev", "nvtx"]' | ||
non-cuda-sub-packages: '["libcufft-dev"]' | ||
linux-local-args: '["--toolkit"]' | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: /usr/share/miniconda/envs/recruit | ||
key: conda-${{ hashFiles('environment.yml') }} | ||
id: cache | ||
- name: Install pre-commit and related tools | ||
run: | | ||
pip install pre-commit cmakelang==${{ env.cmakelang-version}} | ||
sudo apt install cppcheck -y | ||
- name: Update mamba environment if cache is outdated | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: mamba env update -n recruit -f environment.yml | ||
- name: Show tool versions | ||
run: | | ||
echo "nvcc: $(nvcc --version)" | ||
echo "g++: $(g++-${{ env.gcc-version}} --version)" | ||
echo "clang-format: $(clang-format --version)" | ||
echo "clang-tidy: $(clang-tidy --version)" | ||
echo "cppcheck: $(cppcheck --version)" | ||
echo "cmake-lint: $(cmake-lint --version)" | ||
echo "cmake-format: $(cmake-format --version)" | ||
- name: Generate compilation database | ||
shell: bash -el {0} | ||
run: | | ||
cmake -DCMAKE_CXX_COMPILER=clang++ -DCUDAWRAPPERS_BUILD_TESTING=True -DCUDAWRAPPERS_BUILD_EXAMPLES=True -S . -B build | ||
cmake -DCMAKE_CXX_COMPILER=g++-${{ env.gcc-version }} -DCUDAWRAPPERS_BUILD_TESTING=True -DCUDAWRAPPERS_BUILD_EXAMPLES=True -S . -B build | ||
- name: Run pre-commit on all files changed in this branch using project standard configuration | ||
shell: bash -el {0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters