Skip to content

dev-container: removed "Test Explorer UI" and "CMake Test Adapter" fr… #106

dev-container: removed "Test Explorer UI" and "CMake Test Adapter" fr…

dev-container: removed "Test Explorer UI" and "CMake Test Adapter" fr… #106

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
permissions:
contents: read # to fetch code (actions/checkout)
packages: read # to fetch packages (docker)
env:
PLATFORMIO_BUILD_FLAGS: -DCI_BUILD
jobs:
Build:
strategy:
matrix:
cmake_preset: ["gcc-13-ci-release", "clang-16-ci-release"]
runs-on: ubuntu-latest
container:
image: ghcr.io/mustafakemalgilor/tdslite/tdslite-devenv:0.3.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --user root
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- uses: actions/cache@v3
with:
# will miss
key: ccache-${{ matrix.cmake_preset }}-${{ github.run_id }}
path: .ccache
# will partial match to a previous cache, if present
restore-keys: |
ccache-${{ matrix.cmake_preset }}
# Try to use latest build's build folder?
- uses: actions/cache@v3
with:
key: build-dir-${{ matrix.cmake_preset }}-${{ github.run_id }}
path: build
restore-keys: |
build-dir-${{ matrix.cmake_preset }}
- name: Pre
run: |
git --version
cmake --version
git config --global --add safe.directory ${GITHUB_WORKSPACE}
echo "gh workspace:" $GITHUB_WORKSPACE
/usr/bin/ccache --set-config cache_dir="${GITHUB_WORKSPACE}/.ccache"
/usr/bin/ccache -sv
- name: Configure
run: cmake --preset ${{ matrix.cmake_preset }}
- name: Build
run: |
cmake --build --preset ${{ matrix.cmake_preset }}
/usr/bin/ccache -sv
Test:
needs: Build
strategy:
matrix:
cmake_preset: ["gcc-13-ci-release", "clang-16-ci-release"]
mssql_version: [2017, 2019, 2022]
runs-on: ubuntu-latest
services:
mssql-2017:
image: mcr.microsoft.com/mssql/server:${{ matrix.mssql_version }}-latest
env:
MSSQL_SA_PASSWORD: "2022-tds-lite-test!"
ACCEPT_EULA: "Y"
container:
image: ghcr.io/mustafakemalgilor/tdslite/tdslite-devenv:0.3.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --user root
steps:
- name: Wait for 90 seconds until SQL server is online
# We don't need any external tools since mssql docker
# container already have sqlcmd available
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get -y update
sudo ACCEPT_EULA=y apt-get -y install mssql-tools unixodbc-dev
/usr/bin/timeout 90 /bin/bash -c 'until /opt/mssql-tools/bin/sqlcmd -S "mssql-2017" -U "sa" -P "2022-tds-lite-test!" -Q "exit"; do >&2 echo "Database is unavailable - sleeping"; sleep 1; done'
- uses: actions/checkout@v3
with:
submodules: "true"
- uses: actions/cache@v3
with:
# will hit
key: build-dir-${{ matrix.cmake_preset }}-${{ github.run_id }}
path: build
- name: Test
run: ctest --preset=${{ matrix.cmake_preset }} --parallel $(nproc) --output-junit ut_reports/all-tests.xml
Device-Toolchain-Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Install PlatformIO libraries
run: |
pio pkg pack -o tdslite.tar.gz
pio lib --global install ./tdslite.tar.gz
pio lib --global install arduino-libraries/Ethernet
pio lib --global install arduino-libraries/WiFiNINA
pio lib --global install ./extras/vendor/MemoryFree
- name: build-avr
run: pio ci --project-option="lib_ignore=CrashMonitor" --board nanoatmega328 --board uno --board megaatmega1280 --board megaatmega2560 --board miniatmega328 --board micro --board yun --board nanoatmega328new --board pro8MHzatmega328 --board ethernet tests/sketches/arduino/arduino.cpp
- name: build-esp
run: pio ci --project-option="lib_ignore=WiFiNINA" --board nodemcu-32s --board nodemcuv2 tests/sketches/esp/esp.cpp
- name: build-rpi
run: pio ci --project-option="lib_ignore=CrashMonitor" --board nanorp2040connect tests/sketches/arduino/arduino.cpp
- name: build-nrf
run: pio ci --project-option="lib_ignore=CrashMonitor" --board nano33ble --board nicla_sense_me tests/sketches/arduino/arduino.cpp
- name: build-stm
run: pio ci --project-option="lib_ignore=CrashMonitor" --board portenta_h7_m4 --board uno --board portenta_h7_m7 tests/sketches/arduino/arduino.cpp
- name: build-samd
run: pio ci --project-option="lib_ignore=CrashMonitor" --board zero tests/sketches/arduino/arduino.cpp
- name: build-arduino-uno-wifi-r2
run: pio ci --project-option="lib_ignore=CrashMonitor" --board uno_wifi_rev2 tests/sketches/esp/esp.cpp
Build-Examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Install PlatformIO libraries
run: |
pio pkg pack -o tdslite.tar.gz
pio lib --global install ./tdslite.tar.gz
pio lib --global install arduino-libraries/Ethernet
pio lib --global install ./extras/vendor/MemoryFree
pio lib --global install arduino-libraries/WiFiNINA
- name: board-example-uno-wifi-r2
run: pio ci --project-option="lib_ignore=CrashMonitor" --board uno_wifi_rev2 examples/boards/uno_wifi_r2/uno_wifi_r2.ino
Arduino-Library-Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: arduino/arduino-lint-action@v1.0.2
with:
library-manager: update
compliance: strict
project-type: library
recursive: false
verbose: true