Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine Simple CI and Clang analysis #5367

Merged
merged 12 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/simple.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Simple CI
on:
pull_request:
types: [opened, synchronize, reopened]
types: [review_requested]
branches:
- "*"
push:
branches:
- master
Expand All @@ -13,6 +15,7 @@ on:
jobs:
cancel_previous:
name: Cancel previous runs
if: github.event.pull_request.draft == false && github.base_ref == 'master' && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot')
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs of outdated commit
Expand All @@ -22,6 +25,7 @@ jobs:
access_token: ${{ github.token }}
hosted:
name: CPU-only
if: github.event.pull_request.draft == false && github.base_ref == 'master' && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot')
runs-on: ${{ matrix.os }}
needs: [cancel_previous]
strategy:
Expand Down Expand Up @@ -127,6 +131,7 @@ jobs:
shell: bash
- name: Build (ALL)
if: always()
continue-on-error: ${{ matrix.cmake_generator == 'Ninja' && matrix.build_shared_libs == 'ON' }}
run: |
mkdir -p build
cd build
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,15 @@ jobs:
sudo apt-get update
sudo apt-get install -y llvm-12 llvm-12-dev llvm-12-tools clang-12 libclang-common-12-dev libclang-12-dev \
libopenblas-dev nasm python3-pip ninja-build

- name: Set environment variables
run: |
set -x
echo "CC=clang-12" >> $GITHUB_ENV
echo "CXX=clang++-12" >> $GITHUB_ENV
echo "ONEFLOW_MAYBE_CHECK_ONLY_FN=${PWD}/oneflow/" >> $GITHUB_ENV
echo "ONEFLOW_MAYBE_CHECK_SKIP_FN=.cfg.cpp" >> $GITHUB_ENV
- name: Build Clang plug-in
run: |
export CC=clang-12
export CXX=clang++-12
cd tools/clang-plugin
mkdir build
cd build
Expand All @@ -122,20 +126,21 @@ jobs:
clang_plugin_path="${PWD}/lib/libCheckUnusedMaybe.so"
ldd ${clang_plugin_path}
echo "clang_plugin_path=${clang_plugin_path}" >> $GITHUB_ENV
- name: Check unused Maybe (by building OneFlow with Clang plug-in)
- name: Build (CMake configure)
run: |
export PROJECT_DIR=${PWD}
mkdir build
cd build
export CC=clang-12
export CXX=clang++-12
export ONEFLOW_MAYBE_CHECK_ONLY_FN=${PROJECT_DIR}/oneflow/
export ONEFLOW_MAYBE_CHECK_SKIP_FN=.cfg.cpp
cmake .. -C ../cmake/caches/international/cpu.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DCMAKE_CXX_FLAGS="-fplugin=${{ env.clang_plugin_path }}"
- name: Build (third party)
run: |
cd build
cmake --build . -j$(nproc) --target oneflow_deps
- name: Check unused Maybe (by building OneFlow with Clang plug-in)
run: |
cd build
cmake --build . -j$(nproc)

wait_for_gpu_slot:
Expand Down