Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
boulderdaze committed Jun 7, 2024
1 parent d60dec3 commit 79b67bb
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 455 deletions.
92 changes: 46 additions & 46 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: Clang-Tidy

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
tidy:
name: Run Clang-Tidy
runs-on: ubuntu-latest

steps:
- name: Check out code, generate compile commands
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build clang-tidy and micm docker image
run: docker build -t micm-clang-tidy -f docker/Dockerfile.clang-tidy .

- name: Scan includes
run: |
INCLUDE_FILES=$(find include -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cuh' -o -name '*.inl' \) | grep -v jit | grep -v '.inl' | grep -v '.cuh' )
echo "scanning include files:"
echo ${INCLUDE_FILES} | tr " " "\n"
docker run --name include-scans -e INCLUDE_FILES="${INCLUDE_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" ${INCLUDE_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/json-src/include'
continue-on-error: true

- name: Scan CUDA source
run: |
SOURCE_FILES=$(find src -type f \( -name '*.cu' -o -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \))
echo "scanning src files:"
echo ${SOURCE_FILES} | tr " " "\n"
docker run --name source-scans -e SOURCE_FILES="${SOURCE_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./cuda-build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" --extra-arg "--cuda-gpu-arch=sm_70" ${SOURCE_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/googletest-src/googletest/include -isystem ./cuda-build/_deps/json-src/include'
continue-on-error: true

- name: Scan Test files
run: |
TEST_FILES=$(find test -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cpp' -o -name '*.cuh' -o -name '*.cu' \) ! -path 'test/tutorial/*' ! -path '**/*.cuh' ! -path '**/*jit*' )
echo "scanning test files:"
echo ${TEST_FILES} | tr " " "\n"
docker run --name test-scans -e TEST_FILES="${TEST_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./cuda-build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" --extra-arg "--cuda-gpu-arch=sm_70" ${TEST_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/googletest-src/googletest/include -isystem ./cuda-build/_deps/json-src/include'
continue-on-error: true
# name: Clang-Tidy

# on: [pull_request, workflow_dispatch]

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
# cancel-in-progress: true

# jobs:
# tidy:
# name: Run Clang-Tidy
# runs-on: ubuntu-latest

# steps:
# - name: Check out code, generate compile commands
# uses: actions/checkout@v4
# with:
# ref: ${{ github.head_ref }}
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Build clang-tidy and micm docker image
# run: docker build -t micm-clang-tidy -f docker/Dockerfile.clang-tidy .

# - name: Scan includes
# run: |
# INCLUDE_FILES=$(find include -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cuh' -o -name '*.inl' \) | grep -v jit | grep -v '.inl' | grep -v '.cuh' )
# echo "scanning include files:"
# echo ${INCLUDE_FILES} | tr " " "\n"
# docker run --name include-scans -e INCLUDE_FILES="${INCLUDE_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" ${INCLUDE_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/json-src/include'
# continue-on-error: true

# - name: Scan CUDA source
# run: |
# SOURCE_FILES=$(find src -type f \( -name '*.cu' -o -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \))
# echo "scanning src files:"
# echo ${SOURCE_FILES} | tr " " "\n"
# docker run --name source-scans -e SOURCE_FILES="${SOURCE_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./cuda-build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" --extra-arg "--cuda-gpu-arch=sm_70" ${SOURCE_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/googletest-src/googletest/include -isystem ./cuda-build/_deps/json-src/include'
# continue-on-error: true

# - name: Scan Test files
# run: |
# TEST_FILES=$(find test -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cpp' -o -name '*.cuh' -o -name '*.cu' \) ! -path 'test/tutorial/*' ! -path '**/*.cuh' ! -path '**/*jit*' )
# echo "scanning test files:"
# echo ${TEST_FILES} | tr " " "\n"
# docker run --name test-scans -e TEST_FILES="${TEST_FILES}" -t micm-clang-tidy bash -c 'time clang-tidy -p ./cuda-build/ --config-file="./.clang-tidy" -header-filter=$(pwd)/include/.* --extra-arg "-lcudart_static" --extra-arg "-std=c++20" --extra-arg "--cuda-gpu-arch=sm_70" ${TEST_FILES} -- -Iinclude/ -isystem ./cuda-build/_deps/googletest-src/googletest/include -isystem ./cuda-build/_deps/json-src/include'
# continue-on-error: true
116 changes: 58 additions & 58 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Clang-Format

on:
push:
branches:
- main

jobs:
format:
name: Run Clang-Format
runs-on: ubuntu-latest

steps:
- name: Install Clang-Format
run: sudo apt-get update && sudo apt-get install clang-format && clang-format --version

- name: Check out code, run clang format, push changes
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Format code
run: |
find include -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cuh' -o -name '*.inl' \) -exec clang-format -i --style=file --verbose {} +
find src -type f \( -name '*.cu' -o -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \) -exec clang-format -i --style=file --verbose {} +
find test -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cpp' -o -name '*.cuh' -o -name '*.cu' \) ! -path 'test/tutorial/*' -exec clang-format -i --style=file --verbose {} +
- name: Check for changes
id: check-changes
run: |
git diff --exit-code
continue-on-error: true

- name: Commit and push changes
# a failue of this step means changes were detected
if: steps.check-changes.outcome != 'success'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit"
- name: Push changes to main-formatting branch
# a failue of this step means changes were detected
if: steps.check-changes.outcome != 'success'
run: |
git push origin HEAD:main-formatting
- name: Create Pull Request
# a failue of this step means changes were detected
if: steps.check-changes.outcome != 'success'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Auto-format code using Clang-Format"
title: "Auto-format code changes"
body: "This is an automated pull request to apply code formatting using Clang-Format."
branch: "main-formatting"
# name: Clang-Format

# on:
# push:
# branches:
# - main

# jobs:
# format:
# name: Run Clang-Format
# runs-on: ubuntu-latest

# steps:
# - name: Install Clang-Format
# run: sudo apt-get update && sudo apt-get install clang-format && clang-format --version

# - name: Check out code, run clang format, push changes
# uses: actions/checkout@v4
# with:
# ref: ${{ github.head_ref }}
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Format code
# run: |
# find include -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cuh' -o -name '*.inl' \) -exec clang-format -i --style=file --verbose {} +
# find src -type f \( -name '*.cu' -o -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \) -exec clang-format -i --style=file --verbose {} +
# find test -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cpp' -o -name '*.cuh' -o -name '*.cu' \) ! -path 'test/tutorial/*' -exec clang-format -i --style=file --verbose {} +

# - name: Check for changes
# id: check-changes
# run: |
# git diff --exit-code
# continue-on-error: true

# - name: Commit and push changes
# # a failue of this step means changes were detected
# if: steps.check-changes.outcome != 'success'
# run: |
# git config --global user.name "GitHub Actions"
# git config --global user.email "actions@github.com"
# git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit"

# - name: Push changes to main-formatting branch
# # a failue of this step means changes were detected
# if: steps.check-changes.outcome != 'success'
# run: |
# git push origin HEAD:main-formatting

# - name: Create Pull Request
# # a failue of this step means changes were detected
# if: steps.check-changes.outcome != 'success'
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: "Auto-format code using Clang-Format"
# title: "Auto-format code changes"
# body: "This is an automated pull request to apply code formatting using Clang-Format."
# branch: "main-formatting"
112 changes: 56 additions & 56 deletions .github/workflows/docker_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: Docker

on: [pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
docker-build-and-test:
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile
- Dockerfile.coverage
- Dockerfile.llvm
- Dockerfile.memcheck
- Dockerfile.no_json
- Dockerfile.nvhpc
- Dockerfile.openmp
- Dockerfile.intel
# - Dockerfile.mpi
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
# name: Docker

# on: [pull_request, workflow_dispatch]

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
# cancel-in-progress: true

# jobs:
# docker-build-and-test:
# name: Build and Test - ${{ matrix.dockerfile }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# dockerfile:
# - Dockerfile
# - Dockerfile.coverage
# - Dockerfile.llvm
# - Dockerfile.memcheck
# - Dockerfile.no_json
# - Dockerfile.nvhpc
# - Dockerfile.openmp
# - Dockerfile.intel
# # - Dockerfile.mpi
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# submodules: recursive

- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache

- name: Build Docker image
run: docker build -t micm -f docker/${{ matrix.dockerfile }} .

- name: Run tests in container
# only run this if we are not running coverage tests or have built the cuda files
if: matrix.dockerfile != 'Dockerfile.coverage' && matrix.dockerfile != 'Dockerfile.nvhpc'
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

- name: Run coverage tests in container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'

- name: Copy coverage from container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker cp test-container:build/coverage.info .

- name: Upload coverage report
if: matrix.dockerfile == 'Dockerfile.coverage'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
# - name: Delete huge unnecessary tools folder
# run: rm -rf /opt/hostedtoolcache

# - name: Build Docker image
# run: docker build -t micm -f docker/${{ matrix.dockerfile }} .

# - name: Run tests in container
# # only run this if we are not running coverage tests or have built the cuda files
# if: matrix.dockerfile != 'Dockerfile.coverage' && matrix.dockerfile != 'Dockerfile.nvhpc'
# run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

# - name: Run coverage tests in container
# if: matrix.dockerfile == 'Dockerfile.coverage'
# run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'

# - name: Copy coverage from container
# if: matrix.dockerfile == 'Dockerfile.coverage'
# run: docker cp test-container:build/coverage.info .

# - name: Upload coverage report
# if: matrix.dockerfile == 'Dockerfile.coverage'
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: coverage.info
Loading

0 comments on commit 79b67bb

Please sign in to comment.