Skip to content

Commit

Permalink
Merge pull request #3 from Team846/motor_control_work
Browse files Browse the repository at this point in the history
Motor control work
  • Loading branch information
VyaasBaskar authored Dec 26, 2024
2 parents bb73443 + 27aac02 commit eb7e7e8
Show file tree
Hide file tree
Showing 80 changed files with 2,053 additions and 1,336 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/compilation_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Compilation Check

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
compilation_check:
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup cache directory for PCRE and CppCheck
id: cache-setup
run: |
echo "pcre-8.45" > cache-directory-2.txt
echo "cppcheck-2.12.1" >> cache-directory-2.txt
- name: Cache PCRE and CppCheck
id: cache-deps
uses: actions/cache@v3
with:
path: |
/usr/local/bin/cppcheck
/usr/local/bin/cfg
/usr/local/lib/libpcre.so*
key: ${{ runner.os }}-build-${{ hashFiles('cache-directory-2.txt') }}
restore-keys: |
${{ runner.os }}-build-
- name: Update package index
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt-get update

- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt-get install -y wget build-essential

- name: Download and Install PCRE
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
wget -O pcre-8.45.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download
tar -xzf pcre-8.45.tar.gz
cd pcre-8.45
./configure
make
sudo make install
- name: Download and Install CppCheck
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
wget -O cppcheck.tar.gz https://github.com/danmar/cppcheck/archive/refs/tags/2.12.1.tar.gz
tar -xzf cppcheck.tar.gz
cd cppcheck-2.12.1
make MATCHCOMPILER=yes HAVE_RULES=yes CFGDIR=cfg
sudo cp cppcheck /usr/local/bin/
sudo cp -r cfg /usr/local/bin/cfg
- name: Set Library Path
run: echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/local.conf && sudo ldconfig

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y wget lsb-release software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y clang-format-18
sudo ln -sf /usr/bin/clang-format-18 /usr/bin/clang-format
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Install Roborio Toolchain
run: ./gradlew installRoborioToolchain

- name: Compile code and run tests
run: ./gradlew build -PfromCI -PrunningSpotlessCpp
79 changes: 79 additions & 0 deletions .github/workflows/cpp_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CppCheck

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
cpp_check:
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup cache directory for PCRE and CppCheck
id: cache-setup
run: |
echo "pcre-8.45" > cache-directory-2.txt
echo "cppcheck-2.12.1" >> cache-directory-2.txt
- name: Cache PCRE and CppCheck
id: cache-deps
uses: actions/cache@v3
with:
path: |
/usr/local/bin/cppcheck
/usr/local/bin/cfg
/usr/local/lib/libpcre.so*
key: ${{ runner.os }}-build-${{ hashFiles('cache-directory-2.txt') }}
restore-keys: |
${{ runner.os }}-build-
- name: Update package index
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt-get update

- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt-get install -y wget build-essential

- name: Download and Install PCRE
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
wget -O pcre-8.45.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download
tar -xzf pcre-8.45.tar.gz
cd pcre-8.45
./configure
make
sudo make install
- name: Download and Install CppCheck
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
wget -O cppcheck.tar.gz https://github.com/danmar/cppcheck/archive/refs/tags/2.12.1.tar.gz
tar -xzf cppcheck.tar.gz
cd cppcheck-2.12.1
make MATCHCOMPILER=yes HAVE_RULES=yes CFGDIR=cfg
sudo cp cppcheck /usr/local/bin/
sudo cp -r cfg /usr/local/bin/cfg
- name: Set Library Path
run: echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/local.conf && sudo ldconfig

- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Install Roborio Toolchain
run: ./gradlew installRoborioToolchain

- name: Compile code and run tests
run: ./gradlew runCppCheck -PfromCI -PrunningCppCheckTest
37 changes: 37 additions & 0 deletions .github/workflows/formatting_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Formatting Check

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
formatting_check:
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y wget lsb-release software-properties-common
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y clang-format-18
sudo ln -sf /usr/bin/clang-format-18 /usr/bin/clang-format
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Install Roborio Toolchain
run: ./gradlew installRoborioToolchain

- name: Spotless Check
run: ./gradlew spotlessCheck -PfromCI
99 changes: 0 additions & 99 deletions .github/workflows/verify_code.yaml

This file was deleted.

Loading

0 comments on commit eb7e7e8

Please sign in to comment.