|
| 1 | +name: Run tests with twister |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - v*-branch |
| 8 | + - collab-* |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + - v*-branch |
| 13 | + - collab-* |
| 14 | + schedule: |
| 15 | + # Run at 17:00 UTC on every Saturday |
| 16 | + - cron: '0 17 * * 6' |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +concurrency: |
| 22 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
| 25 | +jobs: |
| 26 | + test-source-db: |
| 27 | + runs-on: ubuntu-24.04 |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + subset: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] |
| 32 | + timeout-minutes: 1440 |
| 33 | + env: |
| 34 | + TWISTER_COMMON: ' --test-config tests/test_config_ci.yaml --no-detailed-test-id --force-color --inline-logs -v -N -M --cmake-only -T tests/kernel' |
| 35 | + COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} |
| 36 | + BASE_REF: ${{ github.base_ref }} |
| 37 | + LLVM_TOOLCHAIN_PATH: /usr/lib/llvm-16 |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 41 | + with: |
| 42 | + ref: ${{ github.event.pull_request.head.sha }} |
| 43 | + path: zephyr |
| 44 | + fetch-depth: 0 |
| 45 | + persist-credentials: false |
| 46 | + |
| 47 | + - name: Set Up Python ${{ matrix.python-version }} |
| 48 | + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 |
| 49 | + with: |
| 50 | + python-version: ${{ matrix.python-version }} |
| 51 | + cache: pip |
| 52 | + cache-dependency-path: scripts/requirements-actions.txt |
| 53 | + |
| 54 | + - name: install-packages |
| 55 | + working-directory: zephyr |
| 56 | + run: | |
| 57 | + pip install -r scripts/requirements-actions.txt --require-hashes |
| 58 | + sudo apt-get update -y |
| 59 | + sudo apt-get install -y lcov gperf |
| 60 | +
|
| 61 | + - name: Setup Zephyr project |
| 62 | + uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6 |
| 63 | + with: |
| 64 | + app-path: zephyr |
| 65 | + toolchains: all |
| 66 | + |
| 67 | + - name: Run Tests with Twister |
| 68 | + working-directory: zephyr |
| 69 | + id: run_twister |
| 70 | + run: | |
| 71 | + export ZEPHYR_BASE=${PWD} |
| 72 | + export ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
| 73 | + ./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS} |
| 74 | + python ./scripts/ci/db/db/gen_test_database.py --directory twister-out/ --output db_${{matrix.subset}}.json |
| 75 | +
|
| 76 | + - name: Upload Database |
| 77 | + if: always() |
| 78 | + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 |
| 79 | + with: |
| 80 | + name: Test/Source DB (Subset ${{ matrix.subset }}) |
| 81 | + if-no-files-found: ignore |
| 82 | + path: | |
| 83 | + db_${{matrix.subset}}.json |
0 commit comments