List based block access #552
Workflow file for this run
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 is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '00 6 1 * *' | |
release: | |
types: | |
- published | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
python -m pip install -U pylint | |
- name: Run Lint | |
#run: pylint --rcfile tests/pylint.rc src/peakrdl_python tests/unit_tests | |
run: pylint --rcfile tests/pylint.rc src/peakrdl_python | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
python -m pip install -U mypy | |
- name: Type Check | |
run: mypy src/peakrdl_python --config-file=tests/.mypy.ini | |
unit_tests: | |
needs: | |
- mypy | |
- lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
- name: Run Unit Tests | |
run: | | |
python -m unittest discover -s tests/unit_tests -t . | |
dev_runner: | |
needs: | |
- mypy | |
- lint | |
- unit_tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[dev] | |
# the generate_and_test script is intended to run directly from source rather than from | |
# the installed package | |
python -m pip uninstall peakrdl-python -y | |
# peakrdl-ipxact is needed for some of the test cases so is imported by the | |
# generate_and_test script | |
# retrieve the example code from the systemRDL compiler | |
wget -L https://raw.githubusercontent.com/SystemRDL/systemrdl-compiler/main/examples/accelera-generic_example.rdl -O tests/testcases/accelera-generic_example.rdl | |
- name: Test Development Runner | |
run: | | |
python -m generate_and_test --RDL_source_file tests/testcases/simulator_test.rdl --root_node simulator_test | |
python -m generate_and_test --RDL_source_file tests/testcases/simulator_test.rdl --root_node simulator_test --async | |
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map | |
peakrdl_integration: | |
needs: | |
- mypy | |
- lint | |
- unit_tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[peakrdl] | |
- name: Run PeakRDL Case | |
run: | | |
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/raw/ | |
peakrdl python tests/testcases/simple.xml tests/testcases/multifile.rdl -o peakrdl_out/raw | |
peakrdl python tests/testcases/extended_memories.rdl -o peakrdl_out/raw/ | |
python -m unittest discover -s peakrdl_out/raw | |
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/raw_async/ --async | |
python -m unittest discover -s peakrdl_out/raw_async | |
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/raw_legacy/ --legacy_block_access | |
python -m unittest discover -s peakrdl_out/raw_legacy | |
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/no_test/ --skip_test_case_generation | |
- name: Check Examples | |
run: | | |
# build the libraries for the two cases | |
cd example/tranversing_address_map/ | |
peakrdl python chip_with_registers.rdl -o . | |
python -m reseting_registers | |
python -m dumping_register_state_to_json_file | |
python -m writing_register_state_from_json_file | |
cd ../.. | |
cd example/simulating_callbacks | |
peakrdl python chip_with_a_GPIO.rdl -o . | |
# this example creates a gui that stays up for ever so needs changing before it can be | |
# in the test suite | |
# python -m flashing_the_LED | |
cd ../.. | |
cd example/optimised_access/ | |
peakrdl python optimised_access.rdl -o . | |
python -m demo_optimised_access | |
cd ../.. | |
cd example/array_access/ | |
peakrdl python array_access.rdl -o . | |
python -m demo_array_access | |
cd ../.. | |
cd example/enumerated_fields/ | |
peakrdl python enumerated_fields.rdl -o . | |
python -m demo_enumerated_fields | |
cd ../.. | |
cd example/why_ral/ | |
peakrdl python gpio.rdl -o . | |
python -m without_ral | |
python -m with_ral | |
python -m with_hal | |
cd ../.. | |
integration_tests: | |
needs: | |
- mypy | |
- lint | |
- unit_tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
# retrieve the example code from the systemRDL compiler | |
wget -L https://raw.githubusercontent.com/SystemRDL/systemrdl-compiler/main/examples/accelera-generic_example.rdl -O tests/testcases/accelera-generic_example.rdl | |
- name: Generate testcases | |
run: | | |
# one of the test cases uses IPxact so we need the importer | |
python -m pip install peakrdl-ipxact | |
# the generated code is type checked with mypy so this is needed | |
python -m pip install mypy | |
python generate_testcases.py | |
mypy testcase_output --config-file=tests/.mypy.ini | |
# pylint --rcfile tests/pylint.rc testcase_output/autopep8 --disable=duplicate-code,line-too-long,too-many-statements,invalid-name,unused-import,too-many-instance-attributes,too-many-arguments,too-many-lines | |
python -m unittest discover -s testcase_output | |
- name: Test Autoformating | |
run: | | |
python -m pip install black | |
cp testcase_output autoformatted_testcase_output -r | |
black autoformatted_testcase_output --line-length 120 | |
python -m unittest discover -s autoformatted_testcase_output | |
#------------------------------------------------------------------------------- | |
build: | |
needs: | |
- integration_tests | |
- dev_runner | |
- peakrdl_integration | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U build | |
- name: Build | |
run: python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
dist/*.tar.gz | |
dist/*.whl | |
#------------------------------------------------------------------------------- | |
deploy: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
# Only publish when a GitHub Release is created. | |
if: github.event_name == 'release' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |