Skip to content

Commit

Permalink
Merge pull request #601 from Cypherock/release/v0.6.1280+
Browse files Browse the repository at this point in the history
Release/v0.6.1280+
  • Loading branch information
vrockz747 authored Nov 25, 2024
2 parents dcebc77 + 0ce3664 commit 8905dbf
Show file tree
Hide file tree
Showing 74 changed files with 6,738 additions and 561 deletions.
294 changes: 142 additions & 152 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,80 @@ on:
- develop
pull_request:
branches:
- "**"
- '**'

jobs:
check-commit-msg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate PR commits
if: github.event_name == 'pull_request'
run: bash ./utilities/ci/test-commit-msg.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Validate PR commits
if: github.event_name == 'pull_request'
run: bash ./utilities/ci/test-commit-msg.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}

check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore clang-tools
id: cache-clang-tools
uses: actions/cache@v3
with:
path: clang-tools
key: clang-tools

- name: Check formatting
env:
CACHED: ${{ steps.cache-clang-tools.outputs.cache-hit }}
SHA_BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-clang-tools.sh;
fi
PATH="$PATH:$(pwd)/clang-tools"
# Check event type here so ci chaching can take effect
if [ ${{ github.event_name }} = 'pull_request' ]; then
bash ./utilities/ci/format-checker.sh ${SHA_BASE}
fi
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore clang-tools
id: cache-clang-tools
uses: actions/cache@v3
with:
path: clang-tools
key: clang-tools

- name: Check formatting
env:
CACHED: ${{ steps.cache-clang-tools.outputs.cache-hit }}
SHA_BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-clang-tools.sh;
fi
PATH="$PATH:$(pwd)/clang-tools"
# Check event type here so ci chaching can take effect
if [ ${{ github.event_name }} = 'pull_request' ]; then
bash ./utilities/ci/format-checker.sh ${SHA_BASE}
fi
static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore clang-tools
id: cache-clang-tools
uses: actions/cache@v3
with:
path: clang-tools
key: clang-tools

- name: Check formatting
env:
CACHED: ${{ steps.cache-clang-tools.outputs.cache-hit }}
SHA_BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-clang-tools.sh;
fi
PATH="$PATH:$(pwd)/clang-tools"
# Check event type here so ci chaching can take effect
if [ ${{ github.event_name }} = 'pull_request' ]; then
bash ./utilities/ci/static-analyzer.sh ${SHA_BASE}
fi
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: clang-tidy-result
path: anaylysis.results
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Restore clang-tools
id: cache-clang-tools
uses: actions/cache@v3
with:
path: clang-tools
key: clang-tools

- name: Check formatting
env:
CACHED: ${{ steps.cache-clang-tools.outputs.cache-hit }}
SHA_BASE: ${{ github.event.pull_request.base.sha }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-clang-tools.sh;
fi
PATH="$PATH:$(pwd)/clang-tools"
# Check event type here so ci chaching can take effect
if [ ${{ github.event_name }} = 'pull_request' ]; then
bash ./utilities/ci/static-analyzer.sh ${SHA_BASE}
fi
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: clang-tidy-result
path: anaylysis.results

build-firmwares:
needs: check-format
Expand All @@ -93,65 +93,60 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"

- name: Restore build-tools
id: cache-build-tools
uses: actions/cache@v3
with:
path: build-tools
key: build-tools

- name: Restore arm-gcc
if: matrix.platform == 'device'
id: cache-arm-gcc
uses: actions/cache@v3
with:
path: arm-gcc
key: arm-gcc

- name: Restore proto-tools
id: cache-proto-tools
uses: actions/cache@v3
with:
path: proto-tools
key: proto-tools

- name: Install target dependencies
if: matrix.platform == 'device'
env:
CACHED: ${{ steps.cache-arm-gcc.outputs.cache-hit }}
PROTO_CACHED: ${{ steps.cache-proto-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-arm-gcc.sh;
fi
if [ ! "${PROTO_CACHED}" = "true" ]; then
bash ./utilities/ci/setup-protoc.sh;
fi
pip install -r utilities/script/requirements.txt
- name: Install simulator dependencies
if: matrix.platform == 'simulator'
run: sudo apt update && sudo apt install libsdl2-dev --no-install-recommends -y

- name: Build binaries
env:
CACHED: ${{ steps.cache-build-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-build-tools.sh;
fi
pip install -r vendor/nanopb/extra/requirements.txt
PATH="$PATH:$(pwd)/build-tools:$(pwd)/arm-gcc/bin:$(pwd)/proto-tools/bin"
./utilities/build.sh -u -f ${{ matrix.firmware }} -t ${{ matrix.target }} -p ${{ matrix.platform }}
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Restore build-tools
id: cache-build-tools
uses: actions/cache@v3
with:
path: build-tools
key: build-tools

- name: Restore arm-gcc
if: matrix.platform == 'device'
id: cache-arm-gcc
uses: actions/cache@v3
with:
path: arm-gcc
key: arm-gcc

- name: Restore proto-tools
id: cache-proto-tools
uses: actions/cache@v3
with:
path: proto-tools
key: proto-tools

- name: Install target dependencies
if: matrix.platform == 'device'
env:
CACHED: ${{ steps.cache-arm-gcc.outputs.cache-hit }}
PROTO_CACHED: ${{ steps.cache-proto-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-arm-gcc.sh;
fi
if [ ! "${PROTO_CACHED}" = "true" ]; then
bash ./utilities/ci/setup-protoc.sh;
fi
pip install -r utilities/script/requirements.txt
- name: Install simulator dependencies
if: matrix.platform == 'simulator'
run: sudo apt update && sudo apt install libsdl2-dev --no-install-recommends -y

- name: Build binaries
env:
CACHED: ${{ steps.cache-build-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-build-tools.sh;
fi
pip install -r vendor/nanopb/extra/requirements.txt
PATH="$PATH:$(pwd)/build-tools:$(pwd)/arm-gcc/bin:$(pwd)/proto-tools/bin"
./utilities/build.sh -u -f ${{ matrix.firmware }} -t ${{ matrix.target }} -p ${{ matrix.platform }}
run-unit-tests:
needs: check-format
Expand All @@ -165,36 +160,31 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"

- name: Restore build-tools
id: cache-build-tools
uses: actions/cache@v3
with:
path: build-tools
key: build-tools

- name: Install simulator dependencies
run: sudo apt update && sudo apt install libsdl2-dev --no-install-recommends -y

- name: Run tests
env:
CACHED: ${{ steps.cache-build-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-build-tools.sh;
fi
PATH="$PATH:$(pwd)/build-tools"
pip install -r vendor/nanopb/extra/requirements.txt
# Ignore any non-zero exits from simulator run using '|| true'
bash ./utilities/run_unit_tests.sh -f ${{ matrix.firmware }} -p ${{ matrix.platform }} > test_results.txt || true
cat test_results.txt
# Unity prints "OK" if all tests pass, "FAIL" if tests fail; return 1 to indicate failure
if [ ! "$(tail -n 1 test_results.txt)" = "OK" ]; then exit 1; fi
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Restore build-tools
id: cache-build-tools
uses: actions/cache@v3
with:
path: build-tools
key: build-tools

- name: Install simulator dependencies
run: sudo apt update && sudo apt install libsdl2-dev --no-install-recommends -y

- name: Run tests
env:
CACHED: ${{ steps.cache-build-tools.outputs.cache-hit }}
run: |
if [ ! "${CACHED}" = "true" ]; then
bash ./utilities/ci/setup-build-tools.sh;
fi
PATH="$PATH:$(pwd)/build-tools"
pip install -r vendor/nanopb/extra/requirements.txt
# Ignore any non-zero exits from simulator run using '|| true'
bash ./utilities/run_unit_tests.sh -f ${{ matrix.firmware }} -p ${{ matrix.platform }} > test_results.txt || true
cat test_results.txt
# Unity prints "OK" if all tests pass, "FAIL" if tests fail; return 1 to indicate failure
if [ ! "$(tail -n 1 test_results.txt)" = "OK" ]; then exit 1; fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ private_key*.?
generated
.venv
venv
.cache/*
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "shell",
"command": "utilities/build.sh",
"args": [
"-tdebug",
"-tdev",
"-fmain",
"-psimulator",
],
Expand Down
Loading

0 comments on commit 8905dbf

Please sign in to comment.