Skip to content

Commit

Permalink
Add ci test-request
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Sep 12, 2024
1 parent 78c8285 commit 4b4ae97
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/pull-request.yml
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

0 comments on commit 4b4ae97

Please sign in to comment.