51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: ci
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
jobs:
|
|
Build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone repo
|
|
uses: actions/checkout@v2
|
|
- name: configure
|
|
run: |
|
|
cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
|
|
- name: build
|
|
run: |
|
|
cmake --build build --config Debug
|
|
- name: Compress Build Directory
|
|
run: tar -czf build.tar.gz build/
|
|
- name: Upload Build Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build
|
|
path: build.tar.gz
|
|
- name: Compile Arduino examples
|
|
run: |
|
|
pushd build
|
|
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
|
|
popd
|
|
export PATH="build/bin:$PATH"
|
|
./examples/arduino/compile-examples.sh
|
|
Test:
|
|
runs-on: ubuntu-latest
|
|
needs: Build # run after Build job
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Download Build Directory
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: build
|
|
- name: Extract Build Directory
|
|
run: tar -xzf build.tar.gz -C build/
|
|
- name: List Build Files
|
|
run: ls -R .
|
|
- name: test
|
|
run: |
|
|
cd build
|
|
ctest
|
|
|