Skip to content

feat(trace): neotrace - PR for testing and self-reviews #33

feat(trace): neotrace - PR for testing and self-reviews

feat(trace): neotrace - PR for testing and self-reviews #33

Workflow file for this run

name: Checks
defaults:
run:
shell: zsh -e {0}
on:
push:
branches:
- master
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- master
jobs:
lint:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version-file: "pyproject.toml"
- name: Install uv ${{ vars.UV_VERSION }}
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
version: ${{ vars.UV_VERSION }}
- name: Run linter for pyspec
run: |
make lint
git diff --exit-code
whitespace:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check for trailing whitespace
run: |
if git grep -n '[[:blank:]]$'; then
echo "Trailing whitespace found. Please fix it."
exit 1
fi
comments:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version-file: "pyproject.toml"
- name: Check fork comments
run: python3 scripts/check_fork_comments.py
framework:
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version-file: "pyproject.toml"
- name: Install uv ${{ vars.UV_VERSION }}
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
version: ${{ vars.UV_VERSION }}
- name: Run framework tests
run: make test component=fw
- name: Prepare test results for upload
if: always()
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-framework-${{ github.run_number }}
- name: Upload framework test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: test-results-framework-${{ github.run_number }}
path: ./tests/core/pyspec/test-results-framework-${{ github.run_number }}
title:
if: github.event_name == 'pull_request'
runs-on: [self-hosted-ghr-custom, size-s-x64, profile-consensusSpecs]
steps:
- name: Check PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking PR title: $PR_TITLE"
# Check length (must be <= 68 characters)
if [ ${#PR_TITLE} -gt 68 ]; then
echo "PR title (${#PR_TITLE} characters) must be <= 68 characters"
exit 1
fi
# Check for leading or trailing whitespace
if [[ "$PR_TITLE" =~ ^[[:space:]] ]] || [[ "$PR_TITLE" =~ [[:space:]]$ ]]; then
echo "PR title must not have leading or trailing whitespace"
exit 1
fi
# Check for double spaces
if [[ "$PR_TITLE" =~ [[:space:]]{2,} ]]; then
echo "PR title must not contain double spaces"
exit 1
fi
# Check if starts with capital letter
if ! [[ "$PR_TITLE" =~ ^[A-Z] ]]; then
echo "PR title must start with a capital letter"
exit 1
fi
# Check if ends with punctuation
if [[ "$PR_TITLE" =~ [.!?,\;]$ ]]; then
echo "PR title must not end with punctuation"
exit 1
fi
# Check for correct tense (imperative mood)
first_word=$(echo "$PR_TITLE" | awk '{print $1}')
if [[ ! "$first_word" =~ ^(Embed|Shed)$ ]]; then
if [[ "$first_word" =~ [^e]ed$ ]] || \
[[ "$first_word" =~ ies$ ]] || \
[[ "$first_word" =~ [^s]es$ ]] || \
[[ "$first_word" =~ [^s]s$ ]]; then
echo "PR title must use imperative mood"
exit 1
fi
fi
echo "PR title is valid"
tests:
needs: [lint, whitespace, comments, framework, title]
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
strategy:
matrix:
fork:
- phase0
- altair
- bellatrix
- capella
- deneb
- electra
- fulu
- gloas
- eip7805
- eip7928
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version-file: "pyproject.toml"
- name: Install uv ${{ vars.UV_VERSION }}
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
version: ${{ vars.UV_VERSION }}
- name: Run pyspec tests for ${{ matrix.fork }}
run: make test component=pyspec preset=minimal fork=${{ matrix.fork }}
- name: Prepare test results for upload
if: always()
run: cp -r ./tests/core/pyspec/test-reports ./tests/core/pyspec/test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
- name: Upload ${{ matrix.fork }} test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}
path: ./tests/core/pyspec/test-results-minimal-${{ matrix.fork }}-${{ github.run_number }}