Skip to content

Commit 8cd5e8f

Browse files
committed
ci(astyle): use astyle-check instead of system one
Since Ubuntu 24.4, astyle package does not accept the same options. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 7728ec9 commit 8cd5e8f

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

.github/workflows/check-astyle.yml

+30-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
11
name: Check code formatting with astyle
2-
32
on:
43
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '*'
8+
- '**.md'
9+
- '**.txt'
510
pull_request:
11+
paths-ignore:
12+
- '*'
13+
- '**.md'
14+
- '**.txt'
615
# Allows you to run this workflow manually from the Actions tab
716
workflow_dispatch:
817
jobs:
9-
check:
10-
name: Check for astyle errors
18+
astyle_check:
1119
runs-on: ubuntu-latest
12-
20+
name: Check for astyle errors
1321
steps:
14-
- run: sudo apt install astyle
15-
- uses: actions/checkout@v3
16-
- run: astyle --project=extras/.astylerc --recursive '*.c*' '*.h'
17-
# If anything changed, this will fail and show the needed changes
18-
- run: git diff --exit-code
22+
# First of all, clone the repo using the checkout action.
23+
- name: Checkout
24+
uses: actions/checkout@main
25+
26+
- name: Astyle check
27+
id: Astyle
28+
uses: stm32duino/actions/astyle-check@main
29+
30+
# Use the output from the `Astyle` step
31+
- name: Astyle Errors
32+
if: failure()
33+
run: |
34+
echo "### Astyle error(s) found to be fixed:" >> GITHUB_STEP_SUMMARY
35+
echo "" >> GITHUB_STEP_SUMMARY
36+
echo "\`\`\`patch" >> GITHUB_STEP_SUMMARY
37+
cat ${{ steps.Astyle.outputs.astyle-result }} >> GITHUB_STEP_SUMMARY
38+
echo "\`\`\`" >> GITHUB_STEP_SUMMARY
39+
exit 1

src/low_power.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ extern "C" {
5353
/* Exported functions ------------------------------------------------------- */
5454

5555
void LowPower_init();
56-
void LowPower_EnableWakeUpPin(uint32_t pin, uint32_t mode);
56+
void LowPower_EnableWakeUpPin(uint32_t pin, uint32_t mode);
5757
void LowPower_EnableWakeUpUart(serial_t *serial, void (*FuncPtr)(void));
5858
void LowPower_sleep(uint32_t regulator);
5959
void LowPower_stop(serial_t *obj);
60-
void LowPower_standby();
60+
void LowPower_standby();
6161
void LowPower_shutdown(bool isRTC);
6262
/* Weaked function */
6363
void SystemClock_ConfigFromStop(void);

0 commit comments

Comments
 (0)