Skip to content

Added CI and Docker workflow #17

Added CI and Docker workflow

Added CI and Docker workflow #17

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-test-docs:
runs-on: ubuntu-24.04
env:
BUILD_DIR: build
CI_IMAGE: gates-ci
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Build Docker image
run: docker build -t "$CI_IMAGE" -f Dockerfile .
- name: Run pipeline inside Docker image
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
-e BUILD_DIR="$BUILD_DIR" \
-e HOME=/tmp/gates-home \
-v "$PWD":/workspace \
-w /workspace \
"$CI_IMAGE" \
bash -lc '
cmake -S . -B "$BUILD_DIR" -DENABLE_TESTING=ON &&
cmake --build "$BUILD_DIR" --target gates_tests -j 2 &&
ctest --test-dir "$BUILD_DIR" --output-on-failure &&
cmake --build "$BUILD_DIR" --target gates -j 2 &&
./$BUILD_DIR/gates --version &&
./$BUILD_DIR/gates examples/example.c /tmp/example.vhdl &&
test -s /tmp/example.vhdl &&
./build_docs.sh &&
cmake --build "$BUILD_DIR" --target cppcheck
'
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: gates-docs-html
path: docs/build/html
if-no-files-found: error