-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
############################################################################### | ||
# | ||
# Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by | ||
# Analog Devices, Inc.), | ||
# Copyright (C) 2023-2024 Analog Devices, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
############################################################################## | ||
|
||
name: Hello World Test | ||
|
||
# Cancels workflows in progress that are in the same PR | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
pull_request: | ||
branches: ["main"] | ||
env: | ||
TEST_DIR: tests | ||
MAX32655: max32655_board_B38 | ||
|
||
jobs: | ||
ActionTest: | ||
# The type of runner that the job will run on | ||
runs-on: [self-hosted] | ||
if: github.event.pull_request.draft == false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
repository: analogdevicesinc/msdk | ||
ref: main | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v4 | ||
- name: Debug | ||
run: ls | ||
|
||
- name: Lock | ||
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected] | ||
with: | ||
boards: | | ||
${{ env.MAX32655 }} | ||
lock: true | ||
|
||
- name: Flash | ||
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected] | ||
with: | ||
board: | | ||
${{ env.MAX32655 }} | ||
project: Hello_World | ||
msdk_path: ${{ github.workspace }} | ||
build: true | ||
|
||
- name: Test | ||
run: | | ||
cd tests | ||
python3 hello_world_test.py | ||
exit $? | ||
- name: Unlock | ||
if: always() | ||
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected] | ||
with: | ||
all_owned: true | ||
lock: false |
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,30 @@ | ||
import serial | ||
import argparse | ||
import sys | ||
import time | ||
from resource_manager import ResourceManager | ||
|
||
if __name__== "__main__": | ||
parser = argparse.ArgumentParser(description='Script to verif Hello world output') | ||
parser.add_argument('board', help='Board to test Hello World on') | ||
args = parser.parse_args() | ||
|
||
board = args.board | ||
rman = ResourceManager() | ||
|
||
|
||
|
||
port = rman.get_item_value(f'{board}.console_port') | ||
port = serial.Serial(port) | ||
|
||
rman.resource_reset(board) | ||
time.sleep(5) | ||
|
||
text = port.read_all().decode('utf-8') | ||
|
||
|
||
text_lower = text.lower() | ||
if 'count' in text_lower and "hello" in text_lower: | ||
sys.exit(0) | ||
else: | ||
sys.exit(-1) |