Skip to content

Commit ba7fc32

Browse files
committed
add pre-commit, run pre-commit before build
1 parent 92badcd commit ba7fc32

File tree

3 files changed

+42
-19
lines changed

3 files changed

+42
-19
lines changed

.github/workflows/githubci.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,36 @@ name: Arduino Library CI
33
on: [pull_request, push, repository_dispatch]
44

55
jobs:
6-
build:
6+
pre-commit:
77
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Run pre-commit
11+
uses: pre-commit/[email protected]
12+
13+
- uses: actions/checkout@v4
14+
with:
15+
repository: adafruit/ci-arduino
16+
path: ci
17+
18+
- name: pre-install
19+
run: bash ci/actions_install.sh
20+
21+
- name: clang
22+
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
23+
24+
- name: doxygen
25+
env:
26+
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
27+
PRETTYNAME : "Adafruit Arcada Library"
28+
run: bash ci/doxy_gen_and_deploy.sh
829

30+
build:
31+
runs-on: ubuntu-latest
32+
needs: pre-commit
933
steps:
10-
- uses: actions/setup-python@v4
11-
with:
12-
python-version: '3.x'
13-
- uses: actions/checkout@v3
14-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v4
1536
with:
1637
repository: adafruit/ci-arduino
1738
path: ci
@@ -24,21 +45,12 @@ jobs:
2445

2546
- name: list
2647
run: |
27-
ls
28-
ls examples/*/build/
48+
ls
49+
ls examples/*/build/
2950
3051
- name: Upload build artifacts
3152
uses: actions/upload-artifact@v4
3253
with:
3354
name: example_uf2s
3455
path: |
35-
examples/*/build/*/*.uf2
36-
37-
- name: clang
38-
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
39-
40-
- name: doxygen
41-
env:
42-
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
43-
PRETTYNAME : "Adafruit PyCamera Library"
44-
run: bash ci/doxy_gen_and_deploy.sh
56+
examples/*/build/*/*.uf2

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/mirrors-clang-format
7+
rev: v15.0.7
8+
hooks:
9+
- id: clang-format
10+
types_or: [c++, c, header]
11+
exclude: \.ino$

tjpgd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static const uint16_t Ipsf[64] =
8787

8888
#if JD_TBLCLIP
8989

90-
#define BYTECLIP(v) Clip8[(unsigned int)(v) & 0x3FF]
90+
#define BYTECLIP(v) Clip8[(unsigned int)(v)&0x3FF]
9191

9292
static const uint8_t Clip8[1024] = {
9393
/* 0..255 */

0 commit comments

Comments
 (0)