Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare new test layout #660

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compare_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
diff_detected: ${{steps.config_diff.outputs.diff}}
artifact_url: ${{steps.save_diff.outputs.artifact-url}}

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good one :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github made a warning that it will change the image under the latest variant to 24.04, so just to avoid wall of warnings, I manually set the version

steps:

- name: Get artifacts from current
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/on-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
get_base_commit:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
commit_number: ${{ steps.get_commits.outputs.commit_number }}
steps:
Expand All @@ -33,16 +33,42 @@ jobs:
with:
reference_commit: "HEAD~${{needs.get_base_commit.outputs.commit_number}}"

discover_target_boards:
runs-on: ubuntu-24.04
outputs:
targets: ${{ steps.platforms.outputs.targets }}
steps:
- name: install yq
run: pip install yq

- name: Checkout
uses: actions/checkout@v4
with:
path: sidewalk

- name: get_platforms
id: platforms
run: |
result=$(yq '.common.platform_allow' sidewalk/samples/sid_end_device/sample.yaml -c)
echo "targets=$result" >> $GITHUB_OUTPUT;
echo "$result"

build_samples:
needs: [discover_target_boards]
uses: ./.github/workflows/samples_build.yml
with:
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}

build_and_run_tests:
needs: [discover_target_boards]
uses: ./.github/workflows/run_tests.yml
with:
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}

Post_fail_to_Teams:
needs: [verify_changes, build_samples, build_and_run_tests]
if: ${{ failure() }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: neonidian/teams-notify-build-status@v4
with:
Expand All @@ -62,7 +88,7 @@ jobs:

post_configuration_diff:
needs: [compare_configuration]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: ${{ fromJson(needs.compare_configuration.outputs.diff_detected)}}
steps:
- uses: actions/download-artifact@v4
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
Run_Configuration:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
NRF_revision: ${{ steps.config.outputs.NRF_revision }}
steps:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
reference_commit: ${{ github.event.pull_request.base.sha }}

save_pr_number:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Save PR number to file
run: |
Expand All @@ -60,14 +60,36 @@ jobs:
path: |
PR_number

discover_target_boards:
runs-on: ubuntu-24.04
outputs:
targets: ${{ steps.platforms.outputs.targets }}
steps:
- name: install yq
run: pip install yq

- name: Checkout
uses: actions/checkout@v4
with:
path: sidewalk

- name: get_platforms
id: platforms
run: |
result=$(yq '.common.platform_allow' sidewalk/samples/sid_end_device/sample.yaml -c)
echo "targets=$result" >> $GITHUB_OUTPUT;
echo "$result"

build_samples:
needs: Run_Configuration
needs: [Run_Configuration, discover_target_boards]
uses: ./.github/workflows/samples_build.yml
with:
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}}
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}

build_and_run_tests:
needs: Run_Configuration
needs: [Run_Configuration, discover_target_boards]
uses: ./.github/workflows/run_tests.yml
with:
nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}}
boards_to_test: ${{needs.discover_target_boards.outputs.targets}}
2 changes: 1 addition & 1 deletion .github/workflows/on-pr_dnm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
do_not_merge:
if: ${{ contains(github.event.*.labels.*.name, 'DNM') }}
name: Prevent Merging
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Check for label
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
triage:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/labeler@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-pr_nrf_manifest_update_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
read_pr_configuration:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
Create_NRF_PR: ${{ steps.config.outputs.Create_NRF_PR }}
steps:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
fi;

create-manifest-pr:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: read_pr_configuration
if: ${{ fromJson(needs.read_pr_configuration.outputs.Create_NRF_PR)}}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-pr_publish_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

create_PR_comment:
needs: [compare_configuration]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
issues: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
needs: [build_documentation, build_samples]
permissions: write-all
name: Create release page
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Download artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_docker_change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:

jobs:
build-and-push-image:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
env:
ARCHIVE: "sidewalk_${{inputs.documentation_tag}}.zip"

runs-on: ubuntu-latest
runs-on: ubuntu-24.04
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
Expand Down
101 changes: 16 additions & 85 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@ on:
default: "main"
boards_to_test:
type: string
required: false
default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp"]'
required: true
default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp", "nrf54l15dk/nrf54l15/cpuapp/ns", "nrf54l15dk/nrf54l10/cpuapp"]'

jobs:
build_manual_tests:
strategy:
fail-fast: false
matrix:
subset: [1, 2, 3, 4, 5]
env:
MAX_SUBSETS: 5

runs-on: ubuntu-latest
build_and_run_x86_tests:
runs-on: ubuntu-24.04
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
Expand All @@ -38,7 +31,8 @@ jobs:
- name: update NRF
run: |
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
west init -m https://github.com/nrfconnect/sdk-nrf --mr main . &&
cp -r /workdir/nrf nrf;
west init -l nrf &&
cd nrf &&
git fetch origin ${{inputs.nrf_revision}}:PR-branch &&
git checkout PR-branch &&
Expand All @@ -51,81 +45,18 @@ jobs:
run: |
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt

- name: Twister build manual tests
run: |
source zephyr/zephyr-env.sh
west twister --testsuite-root sidewalk/tests/manual --inline-logs --overflow-as-errors --enable-size-report --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }}

- name: Prepare artifacts for upload
run: |
mkdir -p subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }}
cp twister-out/twister.json subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: manual-tests-artifacts-${{ matrix.subset }}
path: |
subsets
twister-out/**/*sidewalk*/build.log
twister-out/**/*sidewalk*/zephyr/.config
twister-out/**/*sidewalk*/zephyr/runners.yaml
twister-out/**/*sidewalk*/zephyr/zephyr.elf
twister-out/**/*sidewalk*/zephyr/zephyr.hex
twister-out/**/*sidewalk*/zephyr/merged.hex
twister-out/**/*sidewalk*/zephyr/merged_domains.hex
twister-out/**/*sidewalk*/zephyr/*.dts
twister-out/**/*sidewalk*/zephyr/dfu_application.zip

merge_manual_tests:
needs: build_manual_tests
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
- name: Ccache
id: ccache
uses: actions/cache@v4
with:
delete-merged: true
name: manual-tests-artifacts
pattern: manual-tests-artifacts-*

build_and_run_x86_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
defaults:
run:
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: sidewalk

- name: update NRF
run: |
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
west init -m https://github.com/nrfconnect/sdk-nrf --mr main . &&
cd nrf &&
git fetch origin ${{inputs.nrf_revision}}:PR-branch &&
git checkout PR-branch &&
cd .. &&
west config manifest.group-filter +sidewalk &&
west update -n -o=--depth=1 --path-cache /workdir/ &&
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash

- name: Install Python dependencies
run: |
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
path: ~/.cache/ccache
key: ccache-test_x86-${{ github.run_id }}
restore-keys: ccache-test_x86-

- name: Twister build and run x86 tests
run: |
source zephyr/zephyr-env.sh
west twister --platform native_posix --platform unit_testing --coverage --coverage-basedir sidewalk --coverage-formats html,xml --enable-ubsan --enable-lsan --enable-asan --testsuite-root sidewalk --inline-logs --overflow-as-errors -vvv
west twister --test-config sidewalk/test_config.yaml --level="Github_tests" --testsuite-root sidewalk --platform native_sim --platform native_posix --platform unit_testing --coverage --coverage-basedir sidewalk --coverage-formats html,xml --enable-ubsan --enable-lsan --enable-asan --inline-logs --overflow-as-errors -vvv

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -155,19 +86,19 @@ jobs:
strategy:
fail-fast: false
matrix:
subset: [1, 2, 3, 4]
subset: [1, 2]
board: ${{ fromJson(inputs.boards_to_test) }}
uses: ./.github/workflows/run_tests_dut.yml
with:
subset: ${{ matrix.subset }}
max_subsets: 4
max_subsets: 2
run_tests: true
target_board: ${{ matrix.board }}
nrf_revision: ${{ inputs.nrf_revision }}

merge_tests_on_hw:
needs: build-and-test_on_hw
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: always()
permissions: write-all
steps:
Expand Down
Loading
Loading