-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from NSLS-II-SRX/add-zebra-ioc
Add caproto Zebra IOC
- Loading branch information
Showing
20 changed files
with
1,125 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ on: | |
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -34,36 +32,78 @@ jobs: | |
pipx run nox -s pylint | ||
checks: | ||
# pull requests are a duplicate of a branch push if within the same repo. | ||
if: | ||
github.event_name != 'pull_request' || | ||
github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} | ||
runs-on: ${{ matrix.runs-on }} | ||
needs: [pre-commit] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.12"] | ||
runs-on: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
# runs-on: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: [ubuntu-latest] | ||
|
||
# include: | ||
# - python-version: pypy-3.10 | ||
# runs-on: ubuntu-latest | ||
env: | ||
TZ: America/New_York | ||
|
||
include: | ||
- python-version: pypy-3.10 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v5 | ||
- name: Set env vars | ||
run: | | ||
set -x | ||
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo | ||
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV | ||
export PYTHONVER=$(echo ${{ matrix.python-version }} | sed 's/\.//g') | ||
echo "PYTHONVER=${PYTHONVER}" >> $GITHUB_ENV | ||
export DATETIME_STRING=$(date +%Y%m%d%H%M%S) | ||
echo "DATETIME_STRING=${DATETIME_STRING}" >> $GITHUB_ENV | ||
# - uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: ${{ matrix.python-version }} | ||
# allow-prereleases: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} with conda | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
init-shell: bash | ||
environment-name: ${{env.REPOSITORY_NAME}}-py${{matrix.python-version}} | ||
create-args: >- | ||
python=${{ matrix.python-version }} epics-base setuptools<67 | ||
- name: Install package | ||
run: python -m pip install .[test] | ||
run: | | ||
set -vxeuo pipefail | ||
which caput | ||
python -m pip install .[test] | ||
- name: Test package | ||
run: >- | ||
python -m pytest -ra --cov --cov-report=xml --cov-report=term | ||
--durations=20 | ||
--durations=20 -m "(not hardware) and (not tiled)" -s -vv | ||
- name: Upload test artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{env.REPOSITORY_NAME}}-py${{env.PYTHONVER}}-${{env.DATETIME_STRING}} | ||
path: /tmp/srx-caproto-iocs/ | ||
retention-days: 14 | ||
|
||
- name: Upload coverage report | ||
uses: codecov/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -vxeuo pipefail | ||
|
||
PYTHON_VERSION="${1:-3.11}" | ||
|
||
act -W .github/workflows/ci.yml -j checks --matrix python-version:"${PYTHON_VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -vxeuo pipefail | ||
|
||
CAPROTO_IOC="${1:-srx_caproto_iocs.base}" | ||
DEFAULT_PREFIX="BASE:{{Dev:Save1}}:" | ||
CAPROTO_IOC_PREFIX="${2:-${DEFAULT_PREFIX}}" | ||
# shellcheck source=/dev/null | ||
if [ -f "/etc/profile.d/epics.sh" ]; then | ||
. /etc/profile.d/epics.sh | ||
fi | ||
|
||
export EPICS_CAS_AUTO_BEACON_ADDR_LIST="no" | ||
export EPICS_CAS_BEACON_ADDR_LIST="${EPICS_CA_ADDR_LIST:-127.0.0.255}" | ||
|
||
python -m "${CAPROTO_IOC}" --prefix="${CAPROTO_IOC_PREFIX}" --list-pvs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -vxeuo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "$0")" | ||
|
||
bash "${SCRIPT_DIR}/run-caproto-ioc.sh" srx_caproto_iocs.zebra.caproto_ioc "XF:05IDD-ES:1{{Dev:Zebra2}}:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# shellcheck source=/dev/null | ||
if [ -f "/etc/profile.d/epics.sh" ]; then | ||
. /etc/profile.d/epics.sh | ||
fi | ||
|
||
num="${1:-50}" | ||
|
||
data_dir="/tmp/test/$(date +%Y/%m/%d)" | ||
mkdir -v -p "${data_dir}" | ||
|
||
caput "BASE:{Dev:Save1}:write_dir" "${data_dir}" | ||
caput "BASE:{Dev:Save1}:file_name" "saveme_{num:06d}_{uid}.h5" | ||
caput "BASE:{Dev:Save1}:stage" 1 | ||
caget -S "BASE:{Dev:Save1}:full_file_path" | ||
for i in $(seq "$num"); do | ||
echo "$i" | ||
sleep 0.1 | ||
caput "BASE:{Dev:Save1}:acquire" 1 | ||
done | ||
|
||
caput "BASE:{Dev:Save1}:stage" 0 | ||
|
||
caget -S "BASE:{Dev:Save1}:full_file_path" | ||
|
||
exit 0 |
Oops, something went wrong.