Skip to content

Commit

Permalink
Add CI and pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdepuille committed Apr 11, 2024
1 parent 361d31a commit 099bd39
Show file tree
Hide file tree
Showing 103 changed files with 447 additions and 487 deletions.
2 changes: 1 addition & 1 deletion .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>
</cproject>
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build

on:
push:
branches:
- main
pull_request: {}
workflow_dispatch: {}

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- uses: pre-commit/[email protected]

build:
runs-on: ubuntu-latest

needs: pre-commit

steps:
- uses: actions/checkout@v4

- name: Install ARM toolchain
run: sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi

- name: Build firmware
id: build
run: |
mkdir -p cmake-build-release
cd cmake-build-release
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
make
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ fabric.properties

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

4 changes: 2 additions & 2 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .mxproject
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ SourceFiles#9=../Core/Src/main.c
SourceFolderListSize=1
SourcePath#0=../Core/Src
SourceFiles=;

29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: fix-byte-order-marker
stages: ['commit']
- id: check-case-conflict
stages: ['commit']
- id: check-executables-have-shebangs
stages: ['commit']
- id: check-shebang-scripts-are-executable
stages: ['commit']
- id: check-json
stages: ['commit']
- id: pretty-format-json
stages: ['commit']
- id: check-xml
stages: ['commit']
- id: check-yaml
stages: ['commit']
args:
- "--allow-multiple-documents"
- id: check-merge-conflict
stages: ['commit']
- id: end-of-file-fixer
exclude: '.*\.idea/.*|robots.iml'
stages: ['commit']
- id: trailing-whitespace
stages: ['commit']
1 change: 0 additions & 1 deletion Core/Inc/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ void adcSelectCell4Volt(void);
#endif

#endif /* __ADC_H__ */

1 change: 0 additions & 1 deletion Core/Inc/fdcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ void MX_FDCAN1_Init(void);
#endif

#endif /* __FDCAN_H__ */

1 change: 0 additions & 1 deletion Core/Inc/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ void MX_GPIO_Init(void);
}
#endif
#endif /*__ GPIO_H__ */

1 change: 0 additions & 1 deletion Core/Inc/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ void MX_I2C2_Init(void);
#endif

#endif /* __I2C_H__ */

1 change: 0 additions & 1 deletion Core/Inc/tim.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
#endif

#endif /* __TIM_H__ */

2 changes: 1 addition & 1 deletion Core/Src/itm_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ void println(const char *msg, uint8_t level) {
}
print('\n', level);
#endif
}
}
1 change: 0 additions & 1 deletion Core/Src/stm32g4xx_hal_timebase_tim.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ void HAL_ResumeTick(void)
/* Enable TIM1 Update interrupt */
__HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE);
}

2 changes: 0 additions & 2 deletions Core/Src/system_stm32g4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,3 @@ void SystemCoreClockUpdate(void)
/**
* @}
*/


3 changes: 1 addition & 2 deletions Core/Startup/startup_stm32g474retx.s
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ LoopCopyDataInit:
adds r4, r0, r3
cmp r4, r1
bcc CopyDataInit

/* Zero fill the bss segment. */
ldr r2, =_sbss
ldr r4, =_ebss
Expand Down Expand Up @@ -589,4 +589,3 @@ g_pfnVectors:

.weak FMAC_IRQHandler
.thumb_set FMAC_IRQHandler,Default_Handler

Loading

0 comments on commit 099bd39

Please sign in to comment.