Skip to content

Commit c6671b5

Browse files
committed
chore(dev): revise CI
corresponding to nRF24/.github#23
1 parent d6718da commit c6671b5

8 files changed

Lines changed: 75 additions & 28 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ updates:
1010
# default location of `.github/workflows`
1111
directory: "/"
1212
schedule:
13-
interval: "weekly"
13+
interval: "monthly"
14+
cooldown:
15+
default-days: 5
16+
groups:
17+
actions:
18+
patterns:
19+
- "*"

.github/doxygen.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Running this locally will alter the Doxyfile.
55
Such changes SHOULD NOT be pushed to the remote.
66
"""
7+
78
from pathlib import Path
89
import json
910

@@ -17,9 +18,12 @@ def overwrite_doxygen_value():
1718
properties = json.loads(PROPERTIES.read_text(encoding="utf-8"))
1819
assert "version" in properties
1920
config = CONFIG.read_text(encoding="utf-8")
20-
TMP.write_text("PROJECT_NUMBER = {}\n".format(properties["version"]), encoding="utf-8")
21+
TMP.write_text(
22+
"PROJECT_NUMBER = {}\n".format(properties["version"]), encoding="utf-8"
23+
)
2124
config += f"\n@INCLUDE = {str(TMP)}\n"
2225
CONFIG.write_text(config, encoding="utf-8")
2326

27+
2428
if __name__ == "__main__":
2529
overwrite_doxygen_value()

.github/workflows/build_arduino.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
- "examples/**"
1616
- "!examples/old_backups/**"
1717

18+
permissions: {}
19+
1820
jobs:
1921
build:
2022
uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
@@ -160,4 +162,7 @@ jobs:
160162
report:
161163
needs: [build] # , attiny]
162164
if: github.event_name == 'pull_request'
165+
permissions:
166+
# for posting/updating comments on PR threads
167+
pull-requests: write
163168
uses: nRF24/.github/.github/workflows/arduino_size_deltas.yaml@main

.github/workflows/build_linux.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ on:
2525
- ".github/workflows/build_linux.yml"
2626
push:
2727
branches: [master]
28+
tags: ["*"]
2829
paths:
2930
- "*.h"
3031
- "*.cpp"
@@ -45,13 +46,13 @@ on:
4546
- "pyRF24/setup.py"
4647
- "pyRF24/pyRF24.cpp"
4748
- ".github/workflows/build_linux.yml"
48-
release:
49-
types: [created]
5049

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

54+
permissions: {}
55+
5556
jobs:
5657

5758
####################### using Makefile #############################
@@ -100,6 +101,11 @@ jobs:
100101

101102
- name: provide pigpio
102103
if: ${{ matrix.config-options == '--driver=pigpio' }}
104+
env:
105+
# this env var is supported as of CMake v3.29+
106+
CMAKE_INSTALL_PREFIX: /usr/arm-linux-gnueabihf
107+
# this env var is supported as of CMake v3.21+
108+
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/toolchains/armhf.cmake
103109
run: |
104110
git clone https://github.com/joan2937/pigpio.git
105111
cd pigpio
@@ -108,8 +114,7 @@ jobs:
108114
git checkout $latestTag
109115
mkdir build
110116
cd build
111-
cmake .. -D CMAKE_INSTALL_PREFIX=/usr/arm-linux-gnueabihf \
112-
-D CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/toolchains/armhf.cmake
117+
cmake ..
113118
make
114119
sudo make install
115120
@@ -118,22 +123,26 @@ jobs:
118123
env:
119124
CC: /usr/bin/arm-linux-gnueabihf-gcc
120125
CXX: /usr/bin/arm-linux-gnueabihf-g++
126+
# this env var is supported as of CMake v3.29+
127+
CMAKE_INSTALL_PREFIX: /usr/arm-linux-gnueabihf
128+
# this env var is supported as of CMake v3.21+
129+
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/toolchains/armhf.cmake
121130
run: |
122131
git clone https://github.com/intel-iot-devkit/mraa.git
123132
cd mraa
124133
mkdir build
125134
cd build
126135
cmake .. \
127136
-D BUILDSWIGNODE=OFF \
128-
-D BUILDARCH=arm \
129-
-D CMAKE_INSTALL_PREFIX=/usr/arm-linux-gnueabihf \
130-
-D CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/toolchains/armhf.cmake
137+
-D BUILDARCH=arm
131138
sudo make install
132139
sudo bash -c 'echo "/usr/local/lib/arm-linux-gnueabihf" >> /etc/ld.so.conf'
133140
sudo ldconfig
134141
135142
- name: library configure
136-
run: ./configure ${{ matrix.config-options }}
143+
env:
144+
CONFIG_OPTIONS: ${{ matrix.config-options }}
145+
run: ./configure ${CONFIG_OPTIONS}
137146

138147
- name: library make
139148
run: make
@@ -150,14 +159,13 @@ jobs:
150159
151160
####################### using CMake ################################
152161
using_cmake:
153-
uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main
162+
uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@review-ci
154163
with:
155164
rf24-ref: ${{ github.sha }}
156165
driver: ${{ matrix.driver }}
157166
compiler: ${{ matrix.toolchain.compiler }}
158167
usr-dir: ${{ matrix.toolchain.usr_dir }}
159168
examples-path: examples_linux
160-
deploy-release: ${{ github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') && (matrix.driver =='RPi' || matrix.driver =='SPIDEV') }}
161169
py-wrapper-path: pyRF24
162170
strategy:
163171
fail-fast: false
@@ -195,3 +203,11 @@ jobs:
195203
toolchain:
196204
compiler: "default" # github runner is hosted on a "amd64"
197205
usr_dir: "local"
206+
207+
deploy-release-assets:
208+
needs: [using_cmake]
209+
permissions:
210+
# needed for uploading release assets
211+
contents: write
212+
if: startsWith(github.ref, 'refs/tags/')
213+
uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@review-ci

.github/workflows/build_platformIO.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ on:
1717
- "examples/**"
1818
- "!examples/old_backups/**"
1919
- "!examples/rf24_ATTiny/**"
20-
release:
21-
types: [created]
20+
tags: ["*"]
2221

2322
jobs:
2423
validate_lib_json:
25-
uses: nRF24/.github/.github/workflows/validate_deploy_platformio.yaml@main
26-
secrets: inherit
27-
with:
28-
deploy-release: ${{ github.event_name == 'release' }}
24+
uses: nRF24/.github/.github/workflows/vaildate_platformio.yaml@review-ci
2925

3026
build:
3127
needs: [validate_lib_json]
@@ -55,3 +51,12 @@ jobs:
5551
- "blackpill_f103c8"
5652
- "nodemcuv2"
5753
- "adafruit_qtpy_esp32s2"
54+
55+
deploy-pio-assets:
56+
if: startsWith(github.ref, 'refs/tags/')
57+
needs: [validate_lib_json, build]
58+
permissions:
59+
# needed for uploading release assets
60+
contents: write
61+
uses: nRF24/.github/.github/workflows/deploy_platformio_artifact.yaml@review-ci
62+
secrets: inherit

.github/workflows/build_rp2xxx.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ on:
2424
- "utility/rp2/*"
2525
- "examples_pico/*"
2626

27+
permissions: {}
28+
2729
jobs:
2830
build:
29-
uses: nRF24/.github/.github/workflows/build_pico_sdk.yaml@main
31+
uses: nRF24/.github/.github/workflows/build_pico_sdk.yaml@review-ci
3032
with:
3133
board-id: ${{ matrix.board }}
3234
rf24-ref: ${{ github.sha }}

.github/workflows/clang_format.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ on:
77
branches: [master]
88

99
jobs:
10-
check_formatting:
11-
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
12-
with:
13-
ignore: examples/old_backups|utility/RPi/bcm2835.h|utility/RPi/bcm2835.c
14-
extensions: ino,c,cpp,h
10+
check_formatting:
11+
permissions:
12+
# needed to post review suggestions on a PR
13+
pull-requests: write
14+
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@review-ci
15+
with:
16+
ignore: examples/old_backups|utility/RPi/bcm2835.h|utility/RPi/bcm2835.c
17+
extensions: ino,c,cpp,h

.github/workflows/doxygen.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ on:
3131
- ".github/workflows/doxygen.yml"
3232
- "Doxyfile"
3333
- "library.properties" # get lib version from here
34-
release:
35-
types: [published, edited]
34+
tags: ["*"]
3635
workflow_dispatch:
3736

3837
jobs:
@@ -49,8 +48,15 @@ jobs:
4948
run: npm install -g cspell
5049
- run: npx cspell --gitignore --config cspell.config.yaml .
5150
build-docs:
52-
uses: nRF24/.github/.github/workflows/build_docs.yaml@main
51+
uses: nRF24/.github/.github/workflows/build_docs.yaml@review-ci
5352
with:
54-
deploy-gh-pages: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master') }}
5553
doxygen-version: '1.13.2'
5654
secrets: inherit
55+
56+
deploy-docs:
57+
needs: [build-docs]
58+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
59+
permissions:
60+
id-token: write
61+
uses: nRF24/.github/.github/workflows/deploy_docs.yaml@review-ci
62+
secrets: inherit

0 commit comments

Comments
 (0)