Skip to content

Commit 1a41f85

Browse files
authored
Merge pull request #1377 from slaclab/CI-reorg
Github CI reog and updates
2 parents fbc067e + dd0dcae commit 1a41f85

File tree

3 files changed

+55
-58
lines changed

3 files changed

+55
-58
lines changed

.github/workflows/surf_ci.yml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@
1313
# secrets.GH_TOKEN
1414
# secrets.CONDA_UPLOAD_TOKEN_TAG
1515

16-
name: SURF Integration
16+
name: CI
1717
on: [push]
1818

1919
jobs:
2020

2121
# ----------------------------------------------------------------------------
22-
23-
test_and_document:
24-
name: Test And Generate Documentation
22+
lint:
23+
name: Linting
2524
runs-on: ubuntu-24.04
26-
steps:
2725

28-
# This step checks out a copy of your repository.
26+
steps:
2927
- uses: actions/checkout@v3
3028
with:
3129
fetch-depth: 0
@@ -37,22 +35,19 @@ jobs:
3735
- name: Install dependencies
3836
run: |
3937
sudo apt-get update
40-
sudo apt-get install make python3 python3-pip tclsh ghdl
41-
sudo apt-get install doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
38+
sudo apt-get install -y make python3 python3-pip tclsh ghdl
4239
python -m pip install --upgrade pip
4340
pip install -r pip_requirements.txt
4441
git clone https://github.com/slaclab/ruckus.git
4542
pip install -r ruckus/scripts/pip_requirements.txt
4643
4744
- name: Check for trailing whitespace and tabs
4845
run: |
49-
# Check for trailing whitespace
5046
if grep -rnI '[[:blank:]]$' --include=\*.{vhd,tcl,py} .; then
5147
echo "Error: Trailing whitespace found in the repository!"
5248
exit 1
5349
fi
5450
55-
# Check for tab characters instead of spaces
5651
if grep -rnI $'\t' --include=\*.{vhd,tcl,py} .; then
5752
echo "Error: Tab characters found in the repository! Please use spaces for indentation."
5853
exit 1
@@ -71,18 +66,58 @@ jobs:
7166
run: |
7267
source scripts/vsg_linter.sh
7368
69+
- name: VHDL Syntax Checking
70+
run: |
71+
make MODULES=$PWD analysis
72+
73+
# ----------------------------------------------------------------------------
74+
test:
75+
name: Regression Tests
76+
runs-on: ubuntu-24.04
77+
78+
steps:
79+
- uses: actions/checkout@v3
80+
with:
81+
fetch-depth: 0
82+
83+
- uses: actions/setup-python@v4
84+
with:
85+
python-version: 3.12
86+
87+
- name: Install dependencies
88+
run: |
89+
sudo apt-get update
90+
sudo apt-get install -y make python3 python3-pip tclsh ghdl
91+
python -m pip install --upgrade pip
92+
pip install -r pip_requirements.txt
93+
git clone https://github.com/slaclab/ruckus.git
94+
pip install -r ruckus/scripts/pip_requirements.txt
95+
7496
- name: VHDL Regression Testing
7597
run: |
76-
make MODULES=$PWD
98+
make MODULES=$PWD import
7799
python -m pytest --cov -v -n auto tests/
78100
79101
- name: Code Coverage
80102
run: |
81103
codecov
82104
coverage report -m
83105
106+
# ----------------------------------------------------------------------------
107+
108+
docs:
109+
name: Documentation
110+
runs-on: ubuntu-24.04
111+
112+
steps:
113+
- uses: actions/checkout@v3
114+
115+
- name: Install documentation tools
116+
run: |
117+
sudo apt-get update
118+
sudo apt-get install -y doxygen doxygen-doc doxygen-latex doxygen-gui graphviz
119+
84120
- name: Generate Documentation
85-
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/pre-release'
86121
run: |
87122
doxygen Doxyfile
88123
@@ -96,7 +131,7 @@ jobs:
96131
# ----------------------------------------------------------------------------
97132

98133
gen_release:
99-
needs: [test_and_document]
134+
needs: [lint, test, docs]
100135
uses: slaclab/ruckus/.github/workflows/gen_release.yml@main
101136
with:
102137
version: '1.0.0'
@@ -106,7 +141,7 @@ jobs:
106141
# ----------------------------------------------------------------------------
107142

108143
conda_build_lib:
109-
needs: [test_and_document]
144+
needs: [lint, test, docs]
110145
uses: slaclab/ruckus/.github/workflows/conda_build_lib.yml@main
111146
with:
112147
version: '1.0.0'

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Copyright (c) 2026, The Board of Trustees of the Leland Stanford Junior
2+
Copyright (c) 2026, The Board of Trustees of the Leland Stanford Junior
33
University, through SLAC National Accelerator Laboratory (subject to receipt
44
of any required approvals from the U.S. Dept. of Energy). All rights reserved.
55
Redistribution and use in source and binary forms, with or without

Makefile

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,20 @@
88
# contained in the LICENSE.txt file.
99
#-----------------------------------------------------------------------------
1010

11+
# Define default target
12+
target: analysis
13+
1114
ifndef MODULES
1215
export MODULES = $(abspath $(PWD)/../)
1316
endif
1417

15-
# GHDL/ruckus source loading
1618
export RUCKUS_DIR = $(MODULES)/ruckus
1719
export TOP_DIR = $(abspath $(PWD))
1820
export PROJ_DIR = $(abspath $(PWD))
1921
export OUT_DIR = $(PROJ_DIR)/build
2022

21-
# Path to GHDL proc.tcl
22-
export RUCKUS_PROC_TCL = $(RUCKUS_DIR)/ghdl/proc.tcl
23-
24-
# Bypassing Xilinx Specific code
25-
export VIVADO_VERSION = -1.0
26-
2723
# Override the submodule check because ruckus external of this repo
2824
export OVERRIDE_SUBMODULE_LOCKS = 1
2925

30-
# GHDL build flags
31-
GHDLFLAGS = --workdir=$(OUT_DIR) --ieee=synopsys -fexplicit -frelaxed-rules --warn-no-library
32-
33-
# Include the shared ruckus Makefile header
34-
include $(RUCKUS_DIR)/system_shared.mk
35-
36-
# Override system_shared.mk build string
37-
export GHDL_VERSION = $(shell ghdl -v 2>&1 | head -n 1 | awk '{print $$1, $$2}')
38-
export BUILD_STRING = $(PROJECT): $(GHDL_VERSION), ${BUILD_SYS_NAME} (${BUILD_SVR_TYPE}), Built ${BUILD_DATE} by ${BUILD_USER}
39-
40-
all: syntax
41-
42-
# Test of the variables
43-
.PHONY : test
44-
test:
45-
@echo PWD: $(PWD)
46-
@echo MODULES: $(MODULES)
47-
@echo RUCKUS_DIR: $(RUCKUS_DIR)
48-
@echo PROJ_DIR: $(PROJ_DIR)
49-
@echo OUT_DIR: $(OUT_DIR)
50-
@echo RUCKUS_PROC_TCL: $(RUCKUS_PROC_TCL)
51-
@echo VIVADO_VERSION: $(VIVADO_VERSION)
52-
53-
# Find all the source code and load it into GHDL
54-
.PHONY : src
55-
src:
56-
@$(RUCKUS_DIR)/ghdl/import.tcl > /dev/null 2>&1
57-
58-
# Find all the source code and load it into GHDL
59-
.PHONY : syntax
60-
syntax: src
61-
@echo "============================================================================="
62-
@echo VHDL Syntax Checking:
63-
@echo "============================================================================="
64-
@ghdl -i $(GHDLFLAGS) --work=surf $(PROJ_DIR)/build/SRC_VHDL/surf/*
65-
@ghdl -i $(GHDLFLAGS) --work=ruckus $(PROJ_DIR)/build/SRC_VHDL/ruckus/*
26+
# Load the common makefile library
27+
include $(MODULES)/ruckus/system_ghdl.mk

0 commit comments

Comments
 (0)