File tree Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change
1
+ # yamllint disable rule:line-length
2
+ ---
3
+ name : Arduino Lint
4
+ on : # yamllint disable-line rule:truthy
5
+ pull_request :
6
+ branches : ['*']
7
+
8
+ jobs :
9
+ arduino-lint :
10
+ runs-on : ubuntu-latest
11
+ container :
12
+ image : dtors/base-cpp:latest
13
+
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v4
17
+
18
+ - name : Configure Git Safe Directory
19
+ run : |
20
+ git config --global --add safe.directory $(pwd)
21
+
22
+ - name : Find affected files
23
+ run : |
24
+ git fetch origin ${{ github.base_ref }} --depth=1
25
+ git diff --name-only origin/${{ github.base_ref }} > affected_files.txt
26
+ echo "Affected files:"
27
+ cat affected_files.txt
28
+
29
+ - name : Find affected ino files
30
+ run : |
31
+ > affected_ino_files.txt
32
+
33
+ while read file; do
34
+ if [[ "$file" == *.ino ]]; then
35
+ echo "$file" >> affected_ino_files.txt
36
+ fi
37
+ done < affected_files.txt
38
+
39
+ sort -u affected_ino_files.txt -o affected_ino_files.txt
40
+ echo "Affected ino files:"
41
+ cat affected_ino_files.txt
42
+ echo "ino_files=$(cat affected_ino_files.txt | tr '\n' ' ')" >> $GITHUB_ENV
43
+ shell : bash
44
+
45
+ - name : Run arduino-lint
46
+ if : env.ino_files != ''
47
+ run : |
48
+ echo "Running: arduino-lint ./arduino"
49
+ arduino-lint ./arduino
50
+
51
+ - name : Skip arduino-lint
52
+ if : env.ino_files == ''
53
+ run : echo "No affected ino files found. Skipping arduino-lint."
Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ RUN apt-get update && apt-get install -y \
37
37
38
38
RUN pip install yamllint
39
39
40
+ RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/install.sh | sh
41
+
40
42
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 && \
41
43
chmod 755 bazelisk-linux-amd64 && \
42
44
mv bazelisk-linux-amd64 /usr/bin/bazelisk
43
- RUN echo "alias bazel='bazelisk'" >> ~/.bashrc
45
+ RUN echo "alias bazel='bazelisk'" >> $HOME/.profile
46
+
47
+ # Add the script to modify the PATH variable in .profile
48
+ ENV HOME=/root
49
+ RUN echo 'if [ -d "$HOME/bin" ] ; then\n PATH="$HOME/bin:$PATH"\n fi' >> $HOME/.profile && \
50
+ echo 'if [ -d "$HOME/usr/bin" ] ; then\n PATH="$HOME/usr/bin:$PATH"\n fi' >> $HOME/.profile
You can’t perform that action at this time.
0 commit comments