|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths-ignore: |
| 6 | + - "doc/**" |
| 7 | + - "README.md" |
| 8 | + - ".github/workflows/*.yml" |
| 9 | + - "!.github/workflows/build.yml" |
| 10 | + schedule: |
| 11 | + # Run every day at 03:00 AM |
| 12 | + - cron: "00 3 * * *" |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-and-test-in-toolchain-bundle: |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + steps: |
| 18 | + - name: Checkout Serial Modem repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + path: serial_modem |
| 22 | + |
| 23 | + - name: Prepare west project |
| 24 | + run: | |
| 25 | + python3 -m pip install west |
| 26 | + west init -l serial_modem |
| 27 | + west update -o=--depth=1 -n |
| 28 | +
|
| 29 | + - name: Install nrfutil and toolchain manager |
| 30 | + run: | |
| 31 | + wget -q https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/executables/x86_64-unknown-linux-gnu/nrfutil |
| 32 | + chmod +x nrfutil |
| 33 | + ./nrfutil install toolchain-manager |
| 34 | +
|
| 35 | + - name: Find proper toolchain bundle |
| 36 | + id: set-tb-id |
| 37 | + run: echo "TOOLCHAIN_BUNDLE_NAME=ncs-toolchain-x86_64-linux-$(./nrf/scripts/print_toolchain_checksum.sh).tar.gz" >> $GITHUB_OUTPUT |
| 38 | + |
| 39 | + - name: Restore toolchain bundle from cache |
| 40 | + id: restore-cached-tb |
| 41 | + uses: actions/cache/restore@v4 |
| 42 | + with: |
| 43 | + path: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 44 | + key: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 45 | + |
| 46 | + - name: Download toolchain bundle if not cached |
| 47 | + if: steps.restore-cached-tb.outputs.cache-hit != 'true' |
| 48 | + run: wget https://files.nordicsemi.com/artifactory/NCS/external/bundles/v3/${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 49 | + |
| 50 | + - name: Save toolchain bundle to cache |
| 51 | + if: steps.restore-cached-tb.outputs.cache-hit != 'true' |
| 52 | + uses: actions/cache/save@v4 |
| 53 | + with: |
| 54 | + path: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 55 | + key: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 56 | + |
| 57 | + - name: Install proper toolchain bundle |
| 58 | + run: ./nrfutil toolchain-manager install --toolchain-bundle ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}} |
| 59 | + |
| 60 | + - name: Build Serial Modem for PR |
| 61 | + if: github.event_name == 'pull_request' |
| 62 | + run: | |
| 63 | + ./nrfutil toolchain-manager launch --chdir serial_modem -- west twister -T . -v --inline-logs --integration |
| 64 | +
|
| 65 | + - name: Build Serial Modem nightly |
| 66 | + if: github.event_name == 'schedule' |
| 67 | + run: | |
| 68 | + ./nrfutil toolchain-manager launch --chdir serial_modem -- west twister -T . -v --inline-logs |
0 commit comments