Skip to content

Add CI job for running build and unit tests, apply formatter #23

Add CI job for running build and unit tests, apply formatter

Add CI job for running build and unit tests, apply formatter #23

Workflow file for this run

name: CI
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup pixi
uses: prefix-dev/setup-pixi@8ca4608ef7f4daeb54f5205b20d0b7cb42f11143 # v0.8.14
with:
pixi-version: v0.56.0
cache: false
frozen: true
- name: Run linting checks
run: pixi run lint
build-and-test:
name: Build and Test
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
rhel_version: [9, 10]
container:
image: ghcr.io/nsls2/epics-alma${{ matrix.rhel_version }}:latest
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Create CONFIG_SITE.local
run: |
cat > configure/CONFIG_SITE.local << EOF
# CONFIG_SITE.local for GitHub Actions CI
CHECK_RELEASE=NO
BUILD_IOCS=YES
BUILD_TESTS=YES
WITH_BOOST=NO
BOOST_EXTERNAL=YES
WITH_PVA=YES
WITH_QSRV=YES
WITH_BLOSC=YES
BLOSC_EXTERNAL=NO
WITH_BITSHUFFLE=YES
BITSHUFFLE_EXTERNAL=NO
WITH_GRAPHICSMAGICK=NO
GRAPHICSMAGICK_EXTERNAL=NO
GRAPHICSMAGICK_PREFIX_SYMBOLS=YES
WITH_HDF5=YES
HDF5_EXTERNAL=NO
WITH_JSON=YES
WITH_JPEG=YES
JPEG_EXTERNAL=NO
WITH_NETCDF=YES
NETCDF_EXTERNAL=NO
WITH_NEXUS=YES
NEXUS_EXTERNAL=NO
WITH_OPENCV=NO
OPENCV_EXTERNAL=YES
WITH_OPENCV_VIDEO=YES
WITH_SZIP=YES
SZIP_EXTERNAL=NO
WITH_TIFF=YES
TIFF_EXTERNAL=NO
XML2_EXTERNAL=NO
WITH_ZLIB=YES
ZLIB_EXTERNAL=NO
EOF
echo "CONFIG_SITE.local created:"
cat configure/CONFIG_SITE.local
- name: Create RELEASE.local
run: |
cat > configure/RELEASE.local << EOF
# RELEASE.local for GitHub Actions CI
ADSUPPORT=/usr/lib64/epics
ADCORE=/usr/lib64/epics
ASYN=/usr/lib64/epics
AUTOSAVE=/usr/lib64/epics
BUSY=/usr/lib64/epics
CALC=/usr/lib64/epics
DEVIOCSTATS=/usr/lib64/epics
SSCAN=/usr/lib64/epics
STREAM=/usr/lib64/epics
SNCSEQ=/usr/lib64/epics
RECCASTER=/usr/lib64/epics
MOTOR=/usr/lib64/epics
# EPICS_BASE should always be last
EPICS_BASE=/usr/lib64/epics
EOF
echo "RELEASE.local created:"
cat configure/RELEASE.local
# TODO: Fix these upstream
- name: Create missing EPICS configuration files
run: |
wget https://raw.githubusercontent.com/epics-modules/sequencer/refs/heads/main/configure/RULES_SNCSEQ -O /usr/lib64/epics/configure/rules.d/RULES_SNCSEQ
mkdir -p /usr/lib64/epics/ADApp
wget https://raw.githubusercontent.com/areaDetector/ADCore/refs/heads/master/ADApp/commonDriverMakefile -O /usr/lib64/epics/ADApp/commonDriverMakefile
wget https://raw.githubusercontent.com/areaDetector/ADCore/refs/heads/master/ADApp/commonLibraryMakefile -O /usr/lib64/epics/ADApp/commonLibraryMakefile
- name: Install required system packages
run: |
dnf -y install curl-devel zeromq-devel
- name: Build ADXSPD driver and unit tests
run: |
make -j4
- name: Run unit tests
run: |
./bin/linux-x86_64/TestADXSPD