-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
104 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: pull-request | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- "**.md" | ||
- "**/docs/**" | ||
- "**/LICENSE" | ||
- "**/NOTICE" | ||
- "**/benchmark/**" | ||
- "version.txt" | ||
- "build.sh" | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths-ignore: | ||
- "**.md" | ||
- "**/docs/**" | ||
- "**/LICENSE" | ||
- "**/NOTICE" | ||
- "**/benchmark/**" | ||
- "version.txt" | ||
- "build.sh" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: "Pull request#" | ||
required: false | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: RelWithDebInfo | ||
|
||
jobs: | ||
check-style: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install tools | ||
run: sudo apt-get update && sudo apt install -y shellcheck libxml2-utils git python3-pip pylint yamllint && pip3 install codespell | ||
|
||
- name: Check style | ||
working-directory: ${{github.workspace}}/tests/ci | ||
run: python3 code_style_check.py | ||
|
||
build: | ||
runs-on: ubuntu-22.04 | ||
needs: check-style | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install tools | ||
run: sudo apt install -y ninja-build ccache | ||
|
||
- name: Generate Makefile | ||
run: export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
run: ninja -j 10 | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build | ||
path: build/ | ||
|
||
unit-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build | ||
path: ${{github.workspace}}/build/ | ||
|
||
- name: Run unit Tests | ||
working-directory: build | ||
run: ./src/rk_unit_tests --gtest_color=yes | ||
|
||
integration-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build | ||
path: ${{github.workspace}}/build/ | ||
|
||
- name: Run integration Tests | ||
working-directory: ${{github.workspace}}/tests/integration | ||
run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration |