forked from lijiext/lammps
switch to do CodeQL analysis and Unittest on MacOS. currently for PRs and master
This commit is contained in:
parent
6d836d8f30
commit
bfe64629fd
|
@ -4,6 +4,8 @@ name: "CodeQL Code Analysis"
|
|||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
|
@ -14,33 +16,34 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
language: ['cpp', 'python']
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Create Build Environment
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
if: ${{ matrix.language == 'cpp' }}
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake -B build -C cmake/presets/most.cmake cmake -DCMAKE_BUILD_TYPE=Debug
|
||||
make -C build -j2
|
||||
cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake
|
||||
cmake --build . --parallel 2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
name: documentation
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'doc/*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
continue-on-error: true
|
||||
runs-on: ubuntu-latest
|
||||
container: "lammps/buildenv:fedora32_mingw"
|
||||
strategy:
|
||||
matrix:
|
||||
target: ['html', 'pdf', 'spelling']
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Generate ${{ matrix.target }}
|
||||
run: make -C doc ${{ matrix.target }}
|
|
@ -1,42 +0,0 @@
|
|||
name: style
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
check_whitespace:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.6
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade pyyaml
|
||||
sudo apt install -y ninja-build
|
||||
- uses: actions/checkout@master
|
||||
- name: Configure
|
||||
run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake
|
||||
- name: Check for whitespace errors
|
||||
run: cmake --build build --target check-whitespace
|
||||
|
||||
check_permissions:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.6
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade pyyaml
|
||||
sudo apt install -y ninja-build
|
||||
- uses: actions/checkout@master
|
||||
- name: Configure
|
||||
run: cmake -B build -G Ninja -D Python3_EXECUTABLE=$(which python) -S cmake
|
||||
- name: Check file permissions
|
||||
run: cmake --build build --target check-permissions
|
|
@ -0,0 +1,36 @@
|
|||
# GitHub action to build LAMMPS on MacOS and run unit tests
|
||||
name: "Unittest for MacOS"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS Unit Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Create Build Environment
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake \
|
||||
-DENABLE_TESTING=ON -DBUILD_SHARED_LIBS=ON -DLAMMPS_EXCEPTIONS=ON
|
||||
cmake --build . --parallel 2
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: ctest -V
|
Loading…
Reference in New Issue