| name: Build with Clang/LLVM |
| |
| on: pull_request_target |
| |
| jobs: |
| clang-build-cancel: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Cancel Previous Runs |
| uses: styfle/cancel-workflow-action@0.6.0 |
| with: |
| access_token: ${{ github.token }} |
| clang-build: |
| runs-on: ubuntu-latest |
| needs: clang-build-cancel |
| container: |
| image: zephyrprojectrtos/ci:v0.18.3 |
| options: '--entrypoint /bin/bash' |
| strategy: |
| fail-fast: false |
| matrix: |
| subset: [1, 2, 3, 4, 5] |
| env: |
| ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.0 |
| CLANG_ROOT_DIR: /usr/lib/llvm-12 |
| MATRIX_SIZE: 5 |
| steps: |
| - name: Cancel Previous Runs |
| uses: styfle/cancel-workflow-action@0.6.0 |
| with: |
| access_token: ${{ github.token }} |
| - name: Update PATH for west |
| run: | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH |
| |
| - name: checkout |
| uses: actions/checkout@v2 |
| with: |
| ref: ${{ github.event.pull_request.head.sha }} |
| fetch-depth: 0 |
| |
| - name: west setup |
| run: | |
| west init -l . || true |
| west update |
| |
| - name: Check Environment |
| run: | |
| cmake --version |
| ${CLANG_ROOT_DIR}/bin/clang --version |
| gcc --version |
| ls -la |
| |
| - name: Run Tests with Twister |
| run: | |
| #source zephyr-env.sh |
| export ZEPHYR_BASE=${PWD} |
| export ZEPHYR_TOOLCHAIN_VARIANT=llvm |
| ./scripts/twister --inline-logs -M -N -v -p native_posix --subset ${{matrix.subset}}/${MATRIX_SIZE} --retry-failed 3 |
| |
| - name: Upload Unit Test Results |
| if: always() |
| uses: actions/upload-artifact@v2 |
| with: |
| name: Unit Test Results (Subset ${{ matrix.subset }}) |
| path: twister-out/twister.xml |
| |
| publish-test-results: |
| name: "Publish Unit Tests Results" |
| needs: clang-build |
| runs-on: ubuntu-20.04 |
| # the build-and-test job might be skipped, we don't need to run this job then |
| if: success() || failure() |
| |
| steps: |
| - name: Download Artifacts |
| uses: actions/download-artifact@v2 |
| with: |
| path: artifacts |
| |
| - name: Display structure of downloaded files |
| run: ls -R |
| |
| - name: Publish Unit Test Results |
| uses: EnricoMi/publish-unit-test-result-action@v1.12 |
| with: |
| check_name: Unit Test Results |
| github_token: ${{ secrets.GITHUB_TOKEN }} |
| files: "**/twister.xml" |
| comment_on_pr: false |