Skip to content

Commit 3077cf4

Browse files
committed
wip
1 parent 5b7aa0d commit 3077cf4

File tree

4 files changed

+137
-135
lines changed

4 files changed

+137
-135
lines changed

.github/workflows/note-arduino-ci.yml

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

99
jobs:
10-
check_dockerfile_changed:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
changed: ${{ steps.filter.outputs.changed }}
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v3
18-
19-
# TODO: This is a 3rd party GitHub action from some dude. Ideally, we'd
20-
# use something more "official".
21-
- name: Check if Dockerfile changed
22-
uses: dorny/paths-filter@v2
23-
id: filter
24-
with:
25-
base: 'master'
26-
filters: |
27-
changed:
28-
- 'Dockerfile'
29-
build_ci_docker_image:
30-
runs-on: ubuntu-latest
31-
needs: [check_dockerfile_changed]
32-
if: ${{ needs.check_dockerfile_changed.outputs.changed == 'true' }}
33-
34-
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v3
37-
38-
- name: Login to GitHub Container Registry
39-
uses: docker/login-action@v2
40-
with:
41-
registry: ghcr.io
42-
username: ${{ github.actor }}
43-
password: ${{ secrets.GITHUB_TOKEN }}
44-
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v2
47-
48-
- name: Rebuild image
49-
uses: docker/build-push-action@v4
50-
with:
51-
context: .
52-
load: true
53-
tags: ghcr.io/blues/note_arduino_ci:latest
54-
outputs: type=docker,dest=/tmp/note_arduino_ci_image.tar
55-
56-
- name: Upload image artifact
57-
uses: actions/upload-artifact@v3
58-
with:
59-
name: note_arduino_ci_image
60-
path: /tmp/note_arduino_ci_image.tar
10+
# check_dockerfile_changed:
11+
# runs-on: ubuntu-latest
12+
# outputs:
13+
# changed: ${{ steps.filter.outputs.changed }}
14+
15+
# steps:
16+
# - name: Checkout code
17+
# uses: actions/checkout@v3
18+
19+
# # TODO: This is a 3rd party GitHub action from some dude. Ideally, we'd
20+
# # use something more "official".
21+
# - name: Check if Dockerfile changed
22+
# uses: dorny/paths-filter@v2
23+
# id: filter
24+
# with:
25+
# base: 'master'
26+
# filters: |
27+
# changed:
28+
# - 'Dockerfile'
29+
# build_ci_docker_image:
30+
# runs-on: ubuntu-latest
31+
# needs: [check_dockerfile_changed]
32+
# if: ${{ needs.check_dockerfile_changed.outputs.changed == 'true' }}
33+
34+
# steps:
35+
# - name: Checkout code
36+
# uses: actions/checkout@v3
37+
38+
# - name: Login to GitHub Container Registry
39+
# uses: docker/login-action@v2
40+
# with:
41+
# registry: ghcr.io
42+
# username: ${{ github.actor }}
43+
# password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
# - name: Set up Docker Buildx
46+
# uses: docker/setup-buildx-action@v2
47+
48+
# - name: Rebuild image
49+
# uses: docker/build-push-action@v4
50+
# with:
51+
# context: .
52+
# load: true
53+
# tags: ghcr.io/blues/note_arduino_ci:latest
54+
# outputs: type=docker,dest=/tmp/note_arduino_ci_image.tar
55+
56+
# - name: Upload image artifact
57+
# uses: actions/upload-artifact@v3
58+
# with:
59+
# name: note_arduino_ci_image
60+
# path: /tmp/note_arduino_ci_image.tar
6161

6262
run_tests:
6363
runs-on: ubuntu-latest
6464
if: ${{ always() }}
65-
needs: [build_ci_docker_image]
65+
# needs: [build_ci_docker_image]
6666

6767
steps:
6868
- name: Checkout code
6969
uses: actions/checkout@v3
7070

71-
- name: Load CI Docker image
72-
if: ${{ needs.build_ci_docker_image.result == 'success' }}
73-
uses: ./.github/actions/load-ci-image
71+
# - name: Load CI Docker image
72+
# if: ${{ needs.build_ci_docker_image.result == 'success' }}
73+
# uses: ./.github/actions/load-ci-image
7474

7575
- name: Run tests
7676
run: |
@@ -82,82 +82,82 @@ jobs:
8282
- name: Adjust lcov source file paths for Coveralls
8383
run: sudo sed -i 's/\/note-arduino\///g' ./coverage/lcov.info
8484

85-
- name: Publish test coverage
86-
uses: coverallsapp/github-action@master
87-
with:
88-
github-token: ${{ secrets.GITHUB_TOKEN }}
89-
path-to-lcov: ./coverage/lcov.info
90-
91-
build_examples:
92-
runs-on: ubuntu-latest
93-
if: ${{ always() }}
94-
needs: [build_ci_docker_image]
95-
continue-on-error: true
96-
strategy:
97-
matrix:
98-
example-sketch:
99-
- ./examples/Example0_LibrarylessCommunication/Example0_LibrarylessCommunication.ino
100-
- ./examples/Example1_NotecardBasics/Example1_NotecardBasics.ino
101-
- ./examples/Example2_PeriodicCommunications/Example2_PeriodicCommunications.ino
102-
- ./examples/Example3_InboundPolling/Example3_InboundPolling.ino
103-
- ./examples/Example4_InboundInterrupts/Example4_InboundInterrupts.ino
104-
- ./examples/Example5_UsingTemplates/Example5_UsingTemplates.ino
105-
- ./examples/Example6_SensorTutorial/Example6_SensorTutorial.ino
106-
- ./examples/Example7_PowerControl/Example7_PowerControl.ino
107-
# TODO: Uncomment these once note-c is updated with the necessary NoteBinary* functions.
108-
# - ./examples/Example8_BinarySendReceive/Example8_BinarySendReceive.ino
109-
# - ./examples/Example9_BinarySendReceiveChunked/Example9_BinarySendReceiveChunked.ino
110-
fully-qualified-board-name:
111-
- STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
112-
- esp32:esp32:featheresp32
113-
- adafruit:samd:adafruit_feather_m4
114-
- STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
115-
# TODO: Fix this. May require upstream fix.
116-
# - arduino:mbed_nano:nano33ble
117-
- SparkFun:apollo3:sfe_artemis_thing_plus
118-
- STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_L432KC
119-
- adafruit:nrf52:feather52840:softdevice=s140v6
120-
- rp2040:rp2040:rpipico
121-
- arduino:avr:uno
122-
123-
steps:
124-
- name: Checkout code
125-
id: checkout
126-
uses: actions/checkout@v3
127-
128-
- name: Load CI docker image
129-
if: ${{ needs.build_ci_docker_image.result == 'success' }}
130-
uses: ./.github/actions/load-ci-image
131-
132-
- name: Compile Examples
133-
run: |
134-
docker run --rm --volume $(pwd):/note-arduino/ \
135-
--workdir /note-arduino/ \
136-
--entrypoint ./examples/build_example.sh \
137-
ghcr.io/blues/note_arduino_ci:latest \
138-
${{ matrix.fully-qualified-board-name }} \
139-
${{ matrix.example-sketch }}
140-
141-
publish_ci_image:
142-
runs-on: ubuntu-latest
143-
# Make sure tests passed and examples built successfully before publishing.
144-
needs: [build_ci_docker_image, run_tests, build_examples]
145-
# Only publish the image if this is a push event and the Docker image was rebuilt.
146-
if: ${{ github.event_name == 'push' && needs.build_ci_docker_image.result == 'success' }}
147-
148-
steps:
149-
- name: Login to GitHub Container Registry
150-
uses: docker/login-action@v2
151-
with:
152-
registry: ghcr.io
153-
username: ${{ github.actor }}
154-
password: ${{ secrets.GITHUB_TOKEN }}
155-
156-
- name: Set up Docker Buildx
157-
uses: docker/setup-buildx-action@v2
158-
159-
- name: Push image to registry
160-
uses: docker/build-push-action@v4
161-
with:
162-
push: true
163-
tags: ghcr.io/blues/note_arduino_ci:latest
85+
# - name: Publish test coverage
86+
# uses: coverallsapp/github-action@master
87+
# with:
88+
# github-token: ${{ secrets.GITHUB_TOKEN }}
89+
# path-to-lcov: ./coverage/lcov.info
90+
91+
# build_examples:
92+
# runs-on: ubuntu-latest
93+
# if: ${{ always() }}
94+
# needs: [build_ci_docker_image]
95+
# continue-on-error: true
96+
# strategy:
97+
# matrix:
98+
# example-sketch:
99+
# - ./examples/Example0_LibrarylessCommunication/Example0_LibrarylessCommunication.ino
100+
# - ./examples/Example1_NotecardBasics/Example1_NotecardBasics.ino
101+
# - ./examples/Example2_PeriodicCommunications/Example2_PeriodicCommunications.ino
102+
# - ./examples/Example3_InboundPolling/Example3_InboundPolling.ino
103+
# - ./examples/Example4_InboundInterrupts/Example4_InboundInterrupts.ino
104+
# - ./examples/Example5_UsingTemplates/Example5_UsingTemplates.ino
105+
# - ./examples/Example6_SensorTutorial/Example6_SensorTutorial.ino
106+
# - ./examples/Example7_PowerControl/Example7_PowerControl.ino
107+
# # TODO: Uncomment these once note-c is updated with the necessary NoteBinary* functions.
108+
# # - ./examples/Example8_BinarySendReceive/Example8_BinarySendReceive.ino
109+
# # - ./examples/Example9_BinarySendReceiveChunked/Example9_BinarySendReceiveChunked.ino
110+
# fully-qualified-board-name:
111+
# - STMicroelectronics:stm32:BluesW:pnum=SWAN_R5
112+
# - esp32:esp32:featheresp32
113+
# - adafruit:samd:adafruit_feather_m4
114+
# - STMicroelectronics:stm32:GenF4:pnum=FEATHER_F405
115+
# # TODO: Fix this. May require upstream fix.
116+
# # - arduino:mbed_nano:nano33ble
117+
# - SparkFun:apollo3:sfe_artemis_thing_plus
118+
# - STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_L432KC
119+
# - adafruit:nrf52:feather52840:softdevice=s140v6
120+
# - rp2040:rp2040:rpipico
121+
# - arduino:avr:uno
122+
123+
# steps:
124+
# - name: Checkout code
125+
# id: checkout
126+
# uses: actions/checkout@v3
127+
128+
# - name: Load CI docker image
129+
# if: ${{ needs.build_ci_docker_image.result == 'success' }}
130+
# uses: ./.github/actions/load-ci-image
131+
132+
# - name: Compile Examples
133+
# run: |
134+
# docker run --rm --volume $(pwd):/note-arduino/ \
135+
# --workdir /note-arduino/ \
136+
# --entrypoint ./examples/build_example.sh \
137+
# ghcr.io/blues/note_arduino_ci:latest \
138+
# ${{ matrix.fully-qualified-board-name }} \
139+
# ${{ matrix.example-sketch }}
140+
141+
# publish_ci_image:
142+
# runs-on: ubuntu-latest
143+
# # Make sure tests passed and examples built successfully before publishing.
144+
# needs: [build_ci_docker_image, run_tests, build_examples]
145+
# # Only publish the image if this is a push event and the Docker image was rebuilt.
146+
# if: ${{ github.event_name == 'push' && needs.build_ci_docker_image.result == 'success' }}
147+
148+
# steps:
149+
# - name: Login to GitHub Container Registry
150+
# uses: docker/login-action@v2
151+
# with:
152+
# registry: ghcr.io
153+
# username: ${{ github.actor }}
154+
# password: ${{ secrets.GITHUB_TOKEN }}
155+
156+
# - name: Set up Docker Buildx
157+
# uses: docker/setup-buildx-action@v2
158+
159+
# - name: Push image to registry
160+
# uses: docker/build-push-action@v4
161+
# with:
162+
# push: true
163+
# tags: ghcr.io/blues/note_arduino_ci:latest

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ RUN ["dash", "-c", "\
8989
"]
9090

9191
# Configure Arduino CLI
92+
USER ${USER}
9293
RUN ["dash", "-c", "\
9394
arduino-cli config init \
9495
&& arduino-cli config add board_manager.additional_urls \

examples/build_example.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ NOTE_ARDUINO_DIR="$SCRIPT_DIR/.."
88
# be consumed when building the example.
99
if grep -sq 'docker\|lxc' /proc/1/cgroup; then
1010
cp -r $NOTE_ARDUINO_DIR $HOME/Arduino/libraries/Blues_Wireless_Notecard
11+
export HOME=/home/blues
1112
fi
1213

1314
arduino-cli compile \

test/run_all_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ if [ 0 -eq ${all_tests_result} ]; then
168168

169169
# Run coverage if available
170170
if [ $(which lcov) ]; then
171-
rm mock-*.gc?? *_Mock.gc?? *test.gc??
171+
rm -f mock-*.gc?? *_Mock.gc?? *test.gc??
172172
gcov --version \
173173
&& lcov --version \
174174
&& mkdir -p ./coverage \

0 commit comments

Comments
 (0)