On Commit action #82
Workflow file for this run
This file contains 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
name: On Commit action | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
github_context: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Print Github context | |
run: | |
echo '${{toJson(github)}}' | |
validate_code_compliance: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install requirements | |
run: | | |
python3 -m pip install -r ./scripts/ci/requirements.txt | |
- name: Check formatting | |
run: | | |
python3 ./scripts/ci/verify_formatting.py -d -s . -c ./scripts/ci/formatter_cfg.yml | |
- name: Check license | |
run: | | |
python3 ./scripts/ci/verify_license.py -s . -c ./scripts/ci/license.yml | |
validate_compliance_with_zephyr: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/nrfconnect/sdk-sidewalk:main | |
options: --cpus 2 | |
defaults: | |
run: | |
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: get number of commits pushed | |
id: get_commits | |
run: | | |
echo '${{toJson(github.event.commits)}}' > commits.json | |
tr -d '\n' < commits.json > commits_oneline.json | |
LL=$( jq '. | length' commits_oneline.json) | |
echo 'Number of commits pushed: $LL' | |
echo "commit_number=$LL" > $GITHUB_OUTPUT | |
- name: Run Compliance Tests | |
run: | | |
source /workdir/zephyr/zephyr-env.sh | |
cp -r ../sdk-sidewalk /workdir/sidewalk_internal | |
ln -s /workdir/sidewalk_internal /workdir/sidewalk | |
cd /workdir/sidewalk | |
west config manifest.path sidewalk_internal | |
west config manifest.file internal_west.yml | |
west update --narrow | |
python3 scripts/ci/sid_compliance.py --annotate -m yamllint -m kconfigbasic -m devicetreebindings -m binaryfiles -m imagesize -m nits -m gitlint -m identity -c HEAD~${{steps.get_commits.outputs.commit_number}}.. | |
build_samples_and_tests: | |
needs: [validate_code_compliance, validate_compliance_with_zephyr] | |
uses: ./.github/workflows/common-build.yml | |
run_dut_unit_tests: | |
needs: [build_samples_and_tests] | |
uses: ./.github/workflows/common_run_dut_ut.yml | |
publish_test_results: | |
needs: [run_dut_unit_tests] | |
uses: ./.github/workflows/publish_test_results.yml |