ci: workflows: self-hosted local pip cache #896
Workflow file for this run
This file contains hidden or 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
name: Test application release scripts | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- doc/** | |
- scripts/** | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
infuse-release-run: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.28.4.20250818 | |
options: '--entrypoint /bin/bash' | |
volumes: | |
- /repo-cache/embeint:/github/cache/embeint | |
env: | |
BASE_REF: ${{ github.base_ref }} | |
ZEPHYR_TOOLCHAIN_VARIANT: zephyr | |
steps: | |
- name: Workspace cleanup | |
run: | | |
rm -rf ./{*,.*} | |
rm -rf infuse-sdk | |
- name: Clone cached Embeint SDK repository | |
continue-on-error: true | |
run: | | |
git config --global --add safe.directory /github/cache/embeint/infuse-sdk/.git | |
git clone --shared /github/cache/embeint/infuse-sdk infuse-sdk | |
cd infuse-sdk | |
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: infuse-sdk | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: 3.12 | |
cache: pip | |
cache-dependency-path: infuse-sdk/scripts/requirements-actions.txt | |
- name: Install Python packages | |
working-directory: infuse-sdk | |
run: | | |
pip install -r scripts/requirements-actions.txt --require-hashes | |
- name: Environment Setup | |
working-directory: infuse-sdk | |
run: | | |
if [ "${{github.event_name}}" = "pull_request" ]; then | |
git config --global user.email "[email protected]" | |
git config --global user.name "Embeint CI" | |
rm -fr ".git/rebase-apply" | |
git rebase origin/${BASE_REF} | |
git log --pretty=oneline | head -n 10 | |
fi | |
west init -l . || true | |
west config --global update.narrow true | |
west update --path-cache /github/cache/embeint 2>&1 1> west.update.log || west update --path-cache /github/cache/embeint 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/embeint) | |
west forall -c 'git reset --hard HEAD' | |
west blobs fetch hal_nordic nrf_wifi | |
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV | |
- name: Install Zephyr Python packages | |
working-directory: zephyr | |
run: | | |
pip install -r scripts/requirements.txt | |
- name: Check Environment | |
run: | | |
cmake --version | |
gcc --version | |
ls -la /opt/toolchains | |
ls -la | |
echo "github.ref: ${{ github.ref }}" | |
echo "github.base_ref: ${{ github.base_ref }}" | |
echo "github.ref_name: ${{ github.ref_name }}" | |
- name: Generate network key | |
run: | | |
# This generates a random network key for CI purposes | |
# For real applications, this key MUST be generated once and re-used on each build | |
python3 infuse-sdk/scripts/network_key_gen.py --id 0x123456 sample_network.yaml | |
python3 infuse-sdk/scripts/network_key_gen.py --id 0x234567 second_network.yaml | |
- name: Test application release | |
run: | | |
west release-build -r infuse-sdk/samples/releases/data_logger-tauro.yaml --skip-git | |
west release-build -r infuse-sdk/samples/releases/gateway_usb-nrf52840dk.yaml --skip-git | |
west release-build -r infuse-sdk/samples/releases/serial-nrf52840dk.yaml --skip-git | |
west release-build -r infuse-sdk/samples/releases/serial-nrf54l15dk.yaml --skip-git | |
west release-build -r infuse-sdk/samples/releases/serial-nrf9160dk.yaml --skip-git | |
west release-build -r infuse-sdk/samples/releases/serial-nucleo-l432kc.yaml --skip-git | |
- name: Cleanup | |
if: always() | |
run: | | |
rm -rf data_logger-tauro* | |
rm -rf release-sample-gateway* | |
rm -rf release-sample-serial* |