feat(sonar): Add analyze workflow for quality gate approval #503
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
# YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- | |
# SPDX-License-Identifier: Zlib | |
# SPDX-FileCopyrightText: Silicon Laboratories Inc. https://www.silabs.com | |
--- | |
name: build | |
on: # yamllint disable-line rule:truthy | |
push: | |
jobs: | |
build: | |
permissions: | |
contents: read | |
env: | |
project-name: z-wave-protocol-controller # Align to docker (lowercase) | |
runs-on: ${{ vars.RUNNER || 'ubuntu-24.04' }} | |
steps: | |
# yamllint disable-line rule:line-length | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- id: describe | |
name: Describe HEAD | |
run: >- | |
echo "describe=$(git describe --tags --always || echo 0)" | |
| tee $GITHUB_OUTPUT | |
- name: Build Docker image from sources | |
run: >- | |
df -h | |
&& | |
docker build | |
--tag "${{ env.project-name }}:latest" | |
--build-arg | |
UNIFYSDK_GIT_REPOSITORY=${{ secrets.UNIFYSDK_GIT_REPOSITORY }} | |
--build-arg | |
UNIFYSDK_GIT_TAG=${{ secrets.UNIFYSDK_GIT_TAG }} | |
. | |
&& | |
df -h | |
- name: Upload container image | |
# yamllint disable-line rule:line-length | |
uses: ishworkh/container-image-artifact-upload@5d71a2417f0576fa11fe770fb04ece58c4587714 # v2.0.0 | |
with: | |
image: "${{ env.project-name }}:latest" | |
retention_days: 10 | |
- name: Extract artifacts | |
run: >- | |
container=$(docker create "${{ env.project-name }}:latest") | |
&& docker cp | |
${container}:/usr/local/opt/${{ env.project-name }}/dist . | |
- name: Upload artifacts | |
# yamllint disable-line rule:line-length | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
# yamllint disable-line | |
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }} | |
path: dist/ | |
- name: Upload tests artifacts | |
# yamllint disable-line rule:line-length | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
# yamllint disable-line | |
name: ${{ github.event.repository.name }}-tests | |
path: | | |
scripts/tests | |
docker-compose.yml |