-
Notifications
You must be signed in to change notification settings - Fork 4
184 lines (161 loc) · 6.54 KB
/
Copy pathbuild.yml
File metadata and controls
184 lines (161 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir: [wave_sim, freq, spectrum, ahrs, pii_observer, kalman_ou_ii, kalman_ou_iii, imu_calibrate, detrend]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download sim data from oceanography-waves-lib GitHub repo release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download v1.0.9 --repo bareboat-necessities/oceanography-waves-lib --pattern "sim-data-files.zip" --clobber
- name: Unpack simulation data (${{ matrix.dir }})
run: |
unzip -o sim-data-files.zip -d ${{ github.workspace }}/plots/${{ matrix.dir }}
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ make libeigen3-dev \
texlive-xetex texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra dvipng \
python3-pip python3-matplotlib python3-numpy python3-pandas
- name: Compile tests (${{ matrix.dir }})
run: |
cd tests/${{ matrix.dir }}
make
- name: Copy test data (${{ matrix.dir }})
run: |
cp ${{ github.workspace }}/plots/${{ matrix.dir }}/*.csv tests/${{ matrix.dir }}
- name: Run tests (${{ matrix.dir }})
run: |
cd tests/${{ matrix.dir }}
chmod +x *.sh
./run_tests.sh
cp *.csv ../../plots/${{ matrix.dir }}
- name: Generate PGF plots (${{ matrix.dir }})
shell: bash
run: |
cd plots/${{ matrix.dir }}
chmod +x *.sh
./draw_plots.sh
mv -v *.pgf ../../doc/${{ matrix.dir }}/ || true
mv -v *.svg ../../doc/${{ matrix.dir }}/ || true
mv -v *.png ../../doc/${{ matrix.dir }}/ || true
- name: Compile LaTeX document (${{ matrix.dir }})
uses: xu-cheng/latex-action@v4
with:
root_file: "*.tex"
pre_compile: |
echo "openout_any = a" | tee -a $(kpsewhich texmf.cnf)
curl -L https://github.com/plantuml/plantuml/releases/download/v1.2025.4/plantuml.jar -o plantuml.jar
export PLANTUML_JAR=$(pwd)/plantuml.jar
curl -L https://mirrors.ctan.org/macros/luatex/latex/plantuml/plantuml.sty -o plantuml.sty
echo ">> Debug: TeX config patched, now checking PlantUML installation"
plantuml -version || true
java -version || true
work_in_root_file_dir: true
working_directory: doc/${{ matrix.dir }}
latexmk_use_lualatex: true
latexmk_shell_escape: true
args: "-shell-escape"
extra_system_packages: "inkscape ghostscript graphviz ncurses openjdk11-jre"
env:
PLANTUML_JAR: ${{ github.workspace }}/doc/${{ matrix.dir }}/plantuml.jar
- name: Upload PDF artifacts (${{ matrix.dir }})
uses: actions/upload-artifact@v6
with:
name: latex-pdfs-${{ matrix.dir }}
path: doc/${{ matrix.dir }}/**/*.pdf
if-no-files-found: error
- name: Find SVGs (${{ matrix.dir }})
id: find_svgs
shell: bash
run: |
shopt -s nullglob globstar
files=(
doc/${{ matrix.dir }}/**/*pmstokes*H1.5*.svg
doc/${{ matrix.dir }}/**/*pmstokes*medium*.svg
)
if [ ${#files[@]} -gt 0 ]; then
mkdir -p release-svg/${{ matrix.dir }}
for f in "${files[@]}"; do
cp -v "$f" release-svg/${{ matrix.dir }}/
done
echo "found=true" >> "$GITHUB_OUTPUT"
else
echo "found=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload SVG artifacts (${{ matrix.dir }})
if: steps.find_svgs.outputs.found == 'true'
uses: actions/upload-artifact@v6
with:
name: release-svgs-${{ matrix.dir }}
path: release-svg/${{ matrix.dir }}/**/*.svg
if-no-files-found: error
release:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download all workflow artifacts
uses: actions/download-artifact@v8
with:
path: release-assets
merge-multiple: false
- name: Show downloaded files
shell: bash
run: |
find release-assets -type f | sort
- name: Upload PDFs to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release-assets/latex-pdfs-*/*.pdf
tag: ${{ github.ref == 'refs/heads/main' && 'vTest' || github.ref_name }}
overwrite: true
file_glob: true
- name: Upload SVGs to release
shell: bash
run: |
shopt -s nullglob globstar
files=(release-assets/release-svgs-*/*.svg)
if [ ${#files[@]} -eq 0 ]; then
echo "No matching SVG files to upload."
exit 0
fi
printf '%s\n' "${files[@]}" > svg_files.txt
cat svg_files.txt
- name: Upload SVGs to release (serialized)
if: hashFiles('release-assets/release-svgs-*/*.svg') != ''
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release-assets/release-svgs-*/*.svg
tag: ${{ github.ref == 'refs/heads/main' && 'vTest' || github.ref_name }}
overwrite: true
file_glob: true
build-MCU:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ino_dir: [ "imu_fifo" ]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Compile sketch
uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: esp32:esp32:m5stack_atoms3:CDCOnBoot=cdc,USBMode=hwcdc
arduino-platform: esp32:esp32@3.3.5
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
required-libraries: M5Unified@0.2.13,M5GFX@0.2.19,Eigen@0.3.2,Arduino_BMI270_BMM150@1.2.3
sketch-names: "*.ino"
sketch-names-find-start: sensors/${{ matrix.ino_dir }}/*
extra-arduino-cli-args: "--warnings default --build-property compiler.libraries.ldflags=-Wl,--allow-multiple-definition --build-property compiler.cpp.extra_flag=-mvector --build-property compiler.cpp.extra_flag=-funroll-loops --build-property compiler.cpp.extra_flag=-fno-finite-math-only"
set-build-path: true