Skip to content

feat(tools): add clang.cindex-based block header scanner and Cue validation schemas #43

feat(tools): add clang.cindex-based block header scanner and Cue validation schemas

feat(tools): add clang.cindex-based block header scanner and Cue validation schemas #43

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
packages: write
env:
CI_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/gr4-incubator-ci
SDK_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/gr4-incubator-sdk
jobs:
build-test-publish:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR (main only)
uses: docker/login-action@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build CI image (load for test run)
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
target: ci
tags: ${{ env.CI_IMAGE_NAME }}:local
load: true
push: false
cache-from: type=gha,scope=gr4-incubator-ci
cache-to: type=gha,scope=gr4-incubator-ci,mode=max
- name: Configure and build
run: |
docker run --rm \
-v "${{ github.workspace }}:/workspaces/gr4-incubator" \
-w /workspaces/gr4-incubator \
${{ env.CI_IMAGE_NAME }}:local bash -lc '
set -euo pipefail
cmake -S . -B build -G Ninja \
-DENABLE_TESTING=ON \
-DENABLE_EXAMPLES=ON \
-DENABLE_GUI_EXAMPLES=OFF
cmake --build build -j"$(nproc)"
'
- name: Run QA tests
run: |
docker run --rm \
-v "${{ github.workspace }}:/workspaces/gr4-incubator" \
-w /workspaces/gr4-incubator \
${{ env.CI_IMAGE_NAME }}:local bash -lc '
set -euo pipefail
ctest --test-dir build --output-on-failure -R "^qa_"
'
- name: Push tested CI image (main only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
docker tag ${{ env.CI_IMAGE_NAME }}:local ${{ env.CI_IMAGE_NAME }}:latest
docker tag ${{ env.CI_IMAGE_NAME }}:local ${{ env.CI_IMAGE_NAME }}:${{ github.sha }}
docker push ${{ env.CI_IMAGE_NAME }}:latest
docker push ${{ env.CI_IMAGE_NAME }}:${{ github.sha }}
- name: Build and push SDK image (main only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
target: sdk
push: true
tags: |
${{ env.SDK_IMAGE_NAME }}:latest
${{ env.SDK_IMAGE_NAME }}:${{ github.sha }}
cache-from: type=gha,scope=gr4-incubator-sdk
cache-to: type=gha,scope=gr4-incubator-sdk,mode=max