Skip to content

test ci workflow action #1

test ci workflow action

test ci workflow action #1

Workflow file for this run

name: CI Build & Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
# Make sure parallel builds use all available cores
NUM_CORES: ${{ runner.ncpu }}

Check failure on line 16 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI Build & Test

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 16, Col: 18): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.ncpu
steps:
- name: Check out repository
uses: actions/checkout@v3
# ---------------------------
# Part 1: C++ Build & CTest
# ---------------------------
- name: Install C++ build dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential cmake git python3-dev python3-pip
- name: Configure and build C++ code
working-directory: ${{ github.workspace }}
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel "${NUM_CORES}"
- name: Run C++ unit tests with CTest
working-directory: ${{ github.workspace }}/build
run: |
ctest --output-on-failure
# -----------------------------
# Part 2: Python install & tests
# -----------------------------
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Create & activate virtualenv
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools scikit-build pytest
- name: Install package (C++ + Python wrapper) via pip
working-directory: ${{ github.workspace }}
run: |
source venv/bin/activate
pip install .
- name: Run Python unit tests
working-directory: ${{ github.workspace }}
run: |
source venv/bin/activate
pytest -q