chore: upgrade GitHub Actions to use latest versions of setup-python and checkout actions

This commit is contained in:
2026-06-12 09:44:43 +02:00
parent c40ee19c08
commit aca3fda0f5
7 changed files with 109 additions and 114 deletions
+11 -12
View File
@@ -1,24 +1,23 @@
name: Run Pytest with Coverage
on:
on:
workflow_call:
inputs:
BEC_CORE_BRANCH:
description: 'Branch for BEC Core'
description: "Branch for BEC Core"
required: false
default: 'main'
default: "main"
type: string
OPHYD_DEVICES_BRANCH:
description: 'Branch for Ophyd Devices'
description: "Branch for Ophyd Devices"
required: false
default: 'main'
default: "main"
type: string
BEC_WIDGETS_BRANCH:
description: 'Branch for BEC Widgets'
description: "Branch for BEC Widgets"
required: false
default: 'main'
default: "main"
type: string
jobs:
bec:
name: BEC Unit Tests
@@ -29,7 +28,7 @@ jobs:
steps:
- name: Checkout BEC
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: bec-project/bec
ref: ${{ inputs.BEC_CORE_BRANCH }}
@@ -39,7 +38,7 @@ jobs:
with:
BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH }}
OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH }}
PYTHON_VERSION: '3.11'
PYTHON_VERSION: "3.11"
- name: Run Pytest
run: |
cd ./bec
@@ -50,7 +49,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout BEC
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: bec-project/bec
ref: ${{ inputs.BEC_CORE_BRANCH }}
@@ -61,4 +60,4 @@ jobs:
BEC_CORE_BRANCH: ${{ inputs.BEC_CORE_BRANCH }}
OPHYD_DEVICES_BRANCH: ${{ inputs.OPHYD_DEVICES_BRANCH }}
BEC_WIDGETS_BRANCH: ${{ inputs.BEC_WIDGETS_BRANCH }}
PYTHON_VERSION: '3.11'
PYTHON_VERSION: "3.11"
+73 -73
View File
@@ -1,98 +1,98 @@
name: Update device list
on:
push:
branches:
- main
push:
branches:
- main
jobs:
device_list_update:
runs-on: ubuntu-latest
permissions:
contents: read
concurrency:
group: device-list-update-${{ github.ref_name }}
cancel-in-progress: true
device_list_update:
runs-on: ubuntu-latest
permissions:
contents: read
concurrency:
group: device-list-update-${{ github.ref_name }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for git diff / reset
ssh-key: ${{ secrets.CI_DEPLOY_SSH_KEY }}
ssh-known-hosts: ${{ secrets.CI_DEPLOY_SSH_KNOWN_HOSTS }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0 # required for git diff / reset
ssh-key: ${{ secrets.CI_DEPLOY_SSH_KEY }}
ssh-known-hosts: ${{ secrets.CI_DEPLOY_SSH_KNOWN_HOSTS }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Setup | Force release branch to be at workflow sha
run: |
git reset --hard ${{ github.sha }}
- name: Setup | Force release branch to be at workflow sha
run: |
git reset --hard ${{ github.sha }}
- name: Evaluate | Verify upstream has NOT changed
shell: bash
run: |
set +o pipefail
- name: Evaluate | Verify upstream has NOT changed
shell: bash
run: |
set +o pipefail
UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | cut -d' ' -f2 | grep -E '\.{3}' | cut -d'.' -f4)"
printf '%s\n' "Upstream branch name: $UPSTREAM_BRANCH_NAME"
UPSTREAM_BRANCH_NAME="$(git status -sb | head -n 1 | cut -d' ' -f2 | grep -E '\.{3}' | cut -d'.' -f4)"
printf '%s\n' "Upstream branch name: $UPSTREAM_BRANCH_NAME"
set -o pipefail
set -o pipefail
if [ -z "$UPSTREAM_BRANCH_NAME" ]; then
printf >&2 '%s\n' "::error::Unable to determine upstream branch name!"
exit 1
fi
if [ -z "$UPSTREAM_BRANCH_NAME" ]; then
printf >&2 '%s\n' "::error::Unable to determine upstream branch name!"
exit 1
fi
git fetch "${UPSTREAM_BRANCH_NAME%%/*}"
git fetch "${UPSTREAM_BRANCH_NAME%%/*}"
if ! UPSTREAM_SHA="$(git rev-parse "$UPSTREAM_BRANCH_NAME")"; then
printf >&2 '%s\n' "::error::Unable to determine upstream branch sha!"
exit 1
fi
if ! UPSTREAM_SHA="$(git rev-parse "$UPSTREAM_BRANCH_NAME")"; then
printf >&2 '%s\n' "::error::Unable to determine upstream branch sha!"
exit 1
fi
HEAD_SHA="$(git rev-parse HEAD)"
HEAD_SHA="$(git rev-parse HEAD)"
if [ "$HEAD_SHA" != "$UPSTREAM_SHA" ]; then
printf >&2 '%s\n' "[HEAD SHA] $HEAD_SHA != $UPSTREAM_SHA [UPSTREAM SHA]"
printf >&2 '%s\n' "::error::Upstream has changed, aborting release..."
exit 1
fi
if [ "$HEAD_SHA" != "$UPSTREAM_SHA" ]; then
printf >&2 '%s\n' "[HEAD SHA] $HEAD_SHA != $UPSTREAM_SHA [UPSTREAM SHA]"
printf >&2 '%s\n' "::error::Upstream has changed, aborting release..."
exit 1
fi
printf '%s\n' "Verified upstream branch has not changed, continuing..."
printf '%s\n' "Verified upstream branch has not changed, continuing..."
- name: Install Python dependencies
run: |
pip install .
- name: Install Python dependencies
run: |
pip install .
- name: Generate device list
run: |
python .github/scripts/retrieve_device_classes.py \
"ophyd_devices" \
"./ophyd_devices/devices/device_list.md" \
--ignore areadetector.plugins
- name: Generate device list
run: |
python .github/scripts/retrieve_device_classes.py \
"ophyd_devices" \
"./ophyd_devices/devices/device_list.md" \
--ignore areadetector.plugins
- name: Commit and push if device list changed
run: |
FILE="./ophyd_devices/devices/device_list.md"
- name: Commit and push if device list changed
run: |
FILE="./ophyd_devices/devices/device_list.md"
if [ -f "$FILE" ]; then
git add "$FILE"
if [ -f "$FILE" ]; then
git add "$FILE"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff-index --quiet HEAD --; then
git commit -m "docs: Update device list"
if ! git diff-index --quiet HEAD --; then
git commit -m "docs: Update device list"
git push origin "${{ github.ref_name }}"
git push origin "${{ github.ref_name }}"
echo "Device list updated"
else
echo "No changes detected"
fi
else
echo "Device list file not found"
fi
echo "Device list updated"
else
echo "No changes detected"
fi
else
echo "Device list file not found"
fi
+7 -8
View File
@@ -1,16 +1,15 @@
name: Formatter and Pylint jobs
on: [workflow_call]
jobs:
Formatter:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version: "3.13"
- name: Run black and isort
run: |
@@ -22,12 +21,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version: "3.13"
- name: Install dependencies
run: |
@@ -58,4 +57,4 @@ jobs:
name: pylint-artifacts
path: |
# ./pylint/pylint.log # not sure why this isn't working
./pylint/pylint.svg
./pylint/pylint.svg
+6 -7
View File
@@ -1,16 +1,16 @@
name: Run Pytest with different Python versions
on:
on:
workflow_call:
inputs:
BEC_CORE_BRANCH:
description: 'Branch of BEC Core to install'
description: "Branch of BEC Core to install"
required: false
default: 'main'
default: "main"
type: string
OPHYD_DEVICES_BRANCH:
description: 'Branch of Ophyd Devices to install'
description: "Branch of Ophyd Devices to install"
required: false
default: 'main'
default: "main"
type: string
jobs:
@@ -21,9 +21,8 @@ jobs:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout BEC Ophyd Devices
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: bec-project/ophyd_devices
ref: ${{ inputs.OPHYD_DEVICES_BRANCH }}
+7 -9
View File
@@ -1,23 +1,21 @@
name: Run Pytest with Coverage
on:
on:
workflow_call:
inputs:
BEC_CORE_BRANCH:
description: 'Branch of BEC Core to install'
description: "Branch of BEC Core to install"
required: false
default: 'main'
default: "main"
type: string
OPHYD_DEVICES_BRANCH:
description: 'Branch of Ophyd Devices to install'
description: "Branch of Ophyd Devices to install"
required: false
default: 'main'
default: "main"
type: string
secrets:
CODECOV_TOKEN:
required: true
permissions:
pull-requests: write
@@ -27,7 +25,7 @@ jobs:
steps:
- name: Checkout Ophyd Devices
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: bec-project/ophyd_devices
ref: ${{ inputs.OPHYD_DEVICES_BRANCH }}
@@ -51,4 +49,4 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: bec-project/ophyd_devices
slug: bec-project/ophyd_devices
+2 -2
View File
@@ -27,7 +27,7 @@ jobs:
# possible that the branch was updated while the workflow was running. This
# prevents accidentally releasing un-evaluated changes.
- name: Setup | Checkout Repository on Release Branch
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
@@ -35,7 +35,7 @@ jobs:
ssh-known-hosts: ${{ secrets.CI_DEPLOY_SSH_KNOWN_HOSTS }}
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"