From 139ccc787ae77598e82be4d872196aae20ed1460 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen Date: Fri, 15 Dec 2023 15:52:50 +0200 Subject: [PATCH 1/2] ci: use composite checkout --- .github/workflows/compliance.yml | 15 ++++------- .github/workflows/create-upmerge-PRs.yml | 14 ++++------- .github/workflows/docbuild.yml | 13 ++++------ .github/workflows/license-reusable.yml | 32 ++++++------------------ .github/workflows/oss-history.yml | 14 +++++------ .github/workflows/pip-requirements.yml | 15 +++++------ 6 files changed, 34 insertions(+), 69 deletions(-) diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index 8c2cd5003a94..879889ac4df4 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -11,12 +11,11 @@ jobs: run: | echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Checkout the code - uses: actions/checkout@v3 + - name: Checkout sources + uses: karhama/action-checkout@main with: - path: ncs/nrf - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 + git-fetch-depth: 0 + git-ref: ${{ github.event.pull_request.head.sha }} - name: cache-pip uses: actions/cache@v3 @@ -34,13 +33,11 @@ jobs: grep -E "^west" scripts/requirements-fixed.txt | cut -d ' ' -f '1' | xargs pip3 install -U pip3 show -f west - - name: West init and update + - name: Run merge commits test env: BASE_REF: ${{ github.base_ref }} working-directory: ncs/nrf run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" git remote -v # Ensure there's no merge commits in the PR [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ @@ -49,8 +46,6 @@ jobs: git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10 - west init -l . - west update --narrow -o=--depth=1 - name: Run CODEOWNERS test id: codeowners diff --git a/.github/workflows/create-upmerge-PRs.yml b/.github/workflows/create-upmerge-PRs.yml index 206610734e56..42d6a7972768 100644 --- a/.github/workflows/create-upmerge-PRs.yml +++ b/.github/workflows/create-upmerge-PRs.yml @@ -16,11 +16,11 @@ jobs: if: github.repository == 'nrfconnect/sdk-nrf' runs-on: ubuntu-latest steps: - - name: Checkout the code - uses: actions/checkout@v3 + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main with: - path: ncs/nrf - fetch-depth: 0 + git-fetch-depth: 0 + west-update-args: 'zephyr bsim mcuboot' - name: Install base dependencies working-directory: ncs @@ -28,13 +28,9 @@ jobs: pip3 install -r nrf/scripts/requirements-base.txt pip3 install -r nrf/scripts/requirements-extra.txt - - name: West init and update + - name: Get repo urls working-directory: ncs run: | - west init -l nrf - west update zephyr bsim mcuboot - git config --global user.email "noreply@nordicsemi.no" - git config --global user.name "Nordic Builder" echo "SDK_ZEPHYR=$(west list zephyr -f {url} | awk -F// '{print $NF}')" >> $GITHUB_ENV echo "SDK_MCUBOOT=$(west list mcuboot -f {url} | awk -F// '{print $NF}')" >> $GITHUB_ENV diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index 1922cd1c9200..a98deac0fc16 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -31,16 +31,15 @@ jobs: cancel-in-progress: true steps: - - name: Checkout the code - uses: actions/checkout@v3 - with: - path: ncs/nrf - fetch-depth: 0 + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main + - name: cache-pip uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-doc-pip + - name: Install packages run: | sudo apt update @@ -57,11 +56,9 @@ jobs: sudo pip3 install -U setuptools wheel pip pip3 install -r nrf/doc/requirements.txt - - name: West init and update + - name: West zephyr-export working-directory: ncs run: | - west init -l nrf - west update west zephyr-export - name: Build documentation diff --git a/.github/workflows/license-reusable.yml b/.github/workflows/license-reusable.yml index 9ee3c87412e8..90bb6af982df 100644 --- a/.github/workflows/license-reusable.yml +++ b/.github/workflows/license-reusable.yml @@ -32,28 +32,18 @@ on: type: string default: nrf/scripts/ci/license_allow_list.yaml - nrf_repo: - # Optional URL of the custom "sdk-nrf" repository that contains license check - # script and the west manifest. By default official "sdk-nrf" repository is used. - type: string - default: https://github.com/nrfconnect/sdk-nrf - - nrf_rev: - # Optional revision of the "sdk-nrf" repository. By default, "main" is used. - type: string - default: main - jobs: license_job: runs-on: ubuntu-latest name: Run license checks on patch series (PR) steps: - - name: Checkout the code - uses: actions/checkout@v3 + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main with: + git-fetch-depth: 0 + git-ref: ${{ github.event.pull_request.head.sha }} path: ncs/${{ inputs.path }} - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 + west-update-args: '-n zephyr bsim' - name: cache-pip uses: actions/cache@v1 @@ -70,32 +60,24 @@ jobs: pip3 install --user -U west pip3 show -f west - - name: Git config and rebase + - name: Git rebase env: BASE_REF: ${{ github.base_ref }} working-directory: ncs/${{ inputs.path }} run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" git remote -v git branch git rebase origin/${BASE_REF} # debug git log --pretty=oneline | head -n 10 - - name: West init and update + - name: West zephyr-export working-directory: ncs env: PR_REF: ${{ github.event.pull_request.head.sha }} run: | export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/bin:$PATH" - if [ "${{ inputs.path }}" = "nrf" ]; then - west init -l nrf - else - west init -m ${{ inputs.nrf_repo }} --mr ${{ inputs.nrf_rev }} - fi - west update -n zephyr bsim west zephyr-export echo "ZEPHYR_BASE=$(pwd)/zephyr" >> $GITHUB_ENV # debug diff --git a/.github/workflows/oss-history.yml b/.github/workflows/oss-history.yml index 884bd1b1ca8b..aed32f191a98 100644 --- a/.github/workflows/oss-history.yml +++ b/.github/workflows/oss-history.yml @@ -6,22 +6,20 @@ jobs: runs-on: ubuntu-latest name: Check OSS history steps: - - name: Checkout the code - uses: actions/checkout@v3 + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main with: - path: ncs/nrf - fetch-depth: 0 + git-fetch-depth: 0 + west-update-args: '' - name: Install extra python dependencies run: | pip3 install west pip3 install -r ncs/nrf/scripts/requirements-extra.txt - - name: Set up the workspace + - name: Set upsteam + working-directory: ncs run: | - west init -l ncs/nrf - cd ncs - west update git -C zephyr remote add upstream https://github.com/zephyrproject-rtos/zephyr - name: Check manifest userdata diff --git a/.github/workflows/pip-requirements.yml b/.github/workflows/pip-requirements.yml index c03d18b59566..c2af2b08b8d3 100644 --- a/.github/workflows/pip-requirements.yml +++ b/.github/workflows/pip-requirements.yml @@ -16,13 +16,12 @@ jobs: check-requirements: runs-on: ubuntu-20.04 steps: - - name: Checkout PR target branch - uses: actions/checkout@v4 + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main with: - ref: ${{ github.event.pull_request.head.sha }} - path: ncs/nrf - fetch-depth: 1 - persist-credentials: false + git-fetch-depth: 1 + git-ref: ${{ github.event.pull_request.head.sha }} + west-update-args: '--narrow mcuboot zephyr' - name: Get python version id: pyv @@ -39,9 +38,7 @@ jobs: - name: Setup environment working-directory: ncs run: | - pip3 install --user -U setuptools wheel pip virtualenv virtualenvwrapper west - west init -l nrf - west update --narrow mcuboot zephyr + pip3 install --user -U setuptools wheel pip virtualenv virtualenvwrapper - name: Execute script diff action uses: nordicbuilder/action-script-diff@v0.1 From 3c3dd9565bff41239efc3e775de4c15fa554ae86 Mon Sep 17 00:00:00 2001 From: Kari Hamalainen <91663826+karhama@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:07:55 +0200 Subject: [PATCH 2/2] Update applications.rst some changes --- doc/nrf/applications.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/nrf/applications.rst b/doc/nrf/applications.rst index 00ee65eceb6e..13e87f5d11ea 100644 --- a/doc/nrf/applications.rst +++ b/doc/nrf/applications.rst @@ -11,7 +11,7 @@ Some applications target custom hardware designed for a specific use case. You can also run them on different hardware like a generic development kit, but with limited functionality. .. toctree:: - :maxdepth: 1 + :maxdepth: 2 :glob: :caption: Subpages: