diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7fee2d..8f01b38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,29 +8,10 @@ on: env: BUILD_TYPE: Release - BUILD_PATH: ${{ github.workspace}}/build + BUILD_PATH: build BASE_TAG: ci-${{ github.run_id }} jobs: - check-format: - name: Formatting Check - runs-on: ubuntu-latest - strategy: - matrix: - path: - - 'benchmark' - - 'include' - - 'src' - - 'test' - steps: - - uses: actions/checkout@v3 - - - name: Run clang-format style check for C/C++ programs. - uses: jidicula/clang-format-action@v4.10.2 - with: - clang-format-version: '15' - check-path: ${{ matrix.path }} - build-image: runs-on: ubuntu-latest outputs: @@ -55,8 +36,10 @@ jobs: run: docker compose build base - name: Push Docker Image - run: docker compose push base + run: docker compose push base +# TODO: Separate the build job into separate jobs, build, test, benchmark and lint-check +# after resolved the issue https://github.com/actions/upload-artifact/issues/38. build: needs: build-image runs-on: ubuntu-latest @@ -65,7 +48,6 @@ jobs: credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} - steps: - uses: actions/checkout@v3 @@ -73,15 +55,13 @@ jobs: run: cmake -B ${{env.BUILD_PATH}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja - name: Build - run: | - ls ${{env.BUILD_PATH}} - cmake --build ${{env.BUILD_PATH}} --config ${{env.BUILD_TYPE}} - + run: cmake --build ${{env.BUILD_PATH}} --config ${{env.BUILD_TYPE}} + - name: Test run: ctest --test-dir ${{env.BUILD_PATH}} -C ${{env.BUILD_TYPE}} - - name: Linter - run: find . -type f -name "*.h" -not -path '${{env.BUILD_PATH}}/*' -or -name "*.cc" -not -path '${{env.BUILD_PATH}}/*' | xargs clang-tidy -p ${{env.BUILD_PATH}} - - name: Benchmark - run: ${{env.BUILD_PATH}}/bin/cpp-template_benchmark + run: ${{ env.BUILD_PATH }}/bin/cpp-template_benchmark + + - name: Lint check + run: ./scripts/lint/check_all.sh ${{ env.BUILD_PATH }}