Revision clang tidy #72
Workflow file for this run
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
name: Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
BUILD_TYPE: Release | |
BUILD_PATH: build | |
BASE_TAG: ci-${{ github.run_id }} | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
outputs: | |
image_name: ${{ steps.generate_docker_image_name.outputs.image_name}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Docker Image name | |
id: generate_docker_image_name | |
run: | | |
echo "BASE_TAG=${{env.BASE_TAG}}" >> $GITHUB_ENV | |
IMAGE_NAME="ghcr.io/akmaru/cpp-template:base-${{env.BASE_TAG}}" | |
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT | |
- name: Build Docker Image | |
run: docker compose build base | |
- name: Push Docker Image | |
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 | |
container: | |
image: ${{ needs.build-image.outputs.image_name }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.github_token }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure CMake | |
run: cmake -B ${{env.BUILD_PATH}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja | |
- name: Build | |
run: cmake --build ${{env.BUILD_PATH}} --config ${{env.BUILD_TYPE}} | |
- name: Test | |
run: ctest --test-dir ${{env.BUILD_PATH}} -C ${{env.BUILD_TYPE}} | |
- name: Benchmark | |
run: ${{ env.BUILD_PATH }}/bin/cpp-template_benchmark | |
- name: Lint check | |
run: ./scripts/lint/check_all.sh ${{ env.BUILD_PATH }} |