Skip to content

Commit

Permalink
Modify CI for preparing public
Browse files Browse the repository at this point in the history
- Change CCACHE_DIR to use subdir for each matrix
- Use Ninja
- Remove Notify_Slack step
- Fetch tsurugi-action from repo
- Remove id of each step
- Use composite actions for install dependencies
- Divide job into Build and Analysis
  • Loading branch information
akirakw committed Sep 16, 2023
1 parent 3b2e030 commit c4ef99b
Showing 1 changed file with 43 additions and 50 deletions.
93 changes: 43 additions & 50 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
strategy:
fail-fast: false
matrix:
container-tag: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: [self-hosted, docker]
timeout-minutes: 30
container:
image: ghcr.io/project-tsurugi/oltp-sandbox:${{ matrix.container-tag }}
image: ghcr.io/project-tsurugi/oltp-sandbox:${{ matrix.os }}
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
Expand All @@ -21,74 +21,67 @@ jobs:
run:
shell: bash
env:
CCACHE_DIR: ${{ vars.ccache_dir }}
CCACHE_CONFIGPATH: ${{ vars.ccache_dir }}/ccache.conf
CCACHE_DIR: ${{ vars.ccache_dir }}/${{ matrix.os }}

steps:
- id: Checkout
name: Checkout
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.GHA_PAT }}
submodules: true

- id: Checkout_Actions
name: Checkout_Actions
uses: actions/checkout@v3
with:
repository: project-tsurugi/tsurugi-github-actions
path: .github/actions
ref: master
submodules: recursive
token: ${{ secrets.GHA_PAT }}

- id: CMake_Build
name: CMake_Build
- name: CMake_Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=${{ vars.compiler_launcher }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.local -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/.local ..
cmake --build . --target all --clean-first -- -j8
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cmake --build . --target all --clean-first
- id: CTest
name: CTest
continue-on-error: false
- name: CTest
env:
GTEST_OUTPUT: xml
ASAN_OPTIONS: detect_stack_use_after_return=true
run: |
cd build
ctest --verbose
- id: Clang-Tidy
name: Clang-Tidy
- name: Verify
uses: project-tsurugi/tsurugi-annotations-action@v1
if: always()
with:
matrix: ${{ toJson(matrix) }}

Analysis:
runs-on: [self-hosted, docker]
timeout-minutes: 30
container:
image: ghcr.io/project-tsurugi/oltp-sandbox:ubuntu-22.04
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v3

- name: CMake_Generate
run: |
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
- name: Clang-Tidy
run: |
python tools/bin/run-clang-tidy.py -quiet -export-fixes=build/clang-tidy-fix.yaml -p build -extra-arg=-Wno-unknown-warning-option -header-filter=$(pwd)'/(include|src)/.*\.h$' $(pwd)'/src/.*' 2>&1 | awk '!a[$0]++{print > "build/clang-tidy.log"}'
if: matrix.container-tag == 'ubuntu-22.04'
- id: Doxygen
name: Doxygen
- name: Doxygen
run: |
cd build
make doxygen 2> >(tee doxygen-error.log)
if: matrix.container-tag == 'ubuntu-22.04'
ninja doxygen 2> >(tee doxygen-error.log)
- id: Generate_Annotations
name: Generate_Annotations
uses: ./.github/actions/tsurugi-annotations-action
- name: Verify
uses: project-tsurugi/tsurugi-annotations-action@v1
if: always()
with:
matrix: ${{ toJson(matrix) }}

- id: Notify_Slack
name: Notify_Slack
uses: ./.github/actions/tsurugi-slack-action
if: always() && (github.event.pull_request.draft == false) && (contains(github.ref, '/tags/') || contains(github.ref, '/pull/') || contains(github.ref, '/heads/master'))
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
with:
kind: 'job-result'
channel: 'tsurugi-build'
status: ${{ job.status }}
step_context: ${{ toJson(steps) }}
username: ${{ github.workflow }}

0 comments on commit c4ef99b

Please sign in to comment.