Skip to content

Commit

Permalink
fix #318: migrate to new CI framework
Browse files Browse the repository at this point in the history
  • Loading branch information
dhineshkumarmcci committed Aug 25, 2021
1 parent 27d4302 commit 08b282d
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci-arduinocli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
##############################################################################
#
# File: ci-arduinocli.yml
#
# Function:
# YAML file specifying how to do continuous integration for Catena-Arduino-Platform
# (using arduino-cli)
#
##############################################################################

# the name that appears in the GitHub UI, the badge, etc
name: Arduino CI

# global environment
env:
MCCI_CI_LIBRARY: Catena-Arduino-Platform

# specify the events that trigger runs.
on:
# pull requests (default settings)
pull_request:
# pushes (default settings)
push:
# repository operations
repository_dispatch:
schedule:
# do a build once a week at 06:07Z Sunday
- cron: '7 6 * * 0'

# what to do:
jobs:

# define a job named "arduinocli"
arduinocli:
# select a target OS
runs-on: ubuntu-latest
name: ${{ matrix.arch }}

strategy:
fail-fast: false
matrix:
arch: [samd, stm32]
# get info about all the configs.

# step-by-step
steps:
# check out this repo as {root}/Catena-Arduino-Platform
- uses: actions/checkout@v2
name: Check out the repo
with:
path: libraries/${{ env.MCCI_CI_LIBRARY }}

- uses: actions/checkout@v2
name: Set up mcci-catena-ci
with:
repository: mcci-catena/mcci-catena-ci
path: mcci-catena-ci

- name: "Get library: Catena-mcciadk"
uses: actions/checkout@v2
with:
repository: mcci-catena/Catena-mcciadk
path: libraries/Catena-mcciadk

- name: "Get library: MCCI_FRAM_I2C"
uses: actions/checkout@v2
with:
repository: mcci-catena/MCCI_FRAM_I2C
path: libraries/MCCI_FRAM_I2C

- name: "Get library: arduino-lorawan"
uses: actions/checkout@v2
with:
repository: mcci-catena/arduino-lorawan
path: libraries/arduino-lorawan

- name: "Get library: arduino-lmic"
uses: actions/checkout@v2
with:
repository: mcci-catena/arduino-lmic
path: libraries/arduino-lmic

- name: Set up to build
run: bash mcci-catena-ci/setup.sh -l libraries/${{ env.MCCI_CI_LIBRARY }} -a ${{ matrix.arch }}

- name: Display structure of checkout
run: tree -d $(realpath .)

- name: Compile examples
run: bash mcci-catena-ci/Catena-Arduino-Platform-regress-wrap.sh -l libraries/${{env.MCCI_CI_LIBRARY}} -a ${{ matrix.arch }}

### end of file ###
56 changes: 56 additions & 0 deletions ci/Catena-Arduino-Platform-filter-common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

##############################################################################
#
# Module: Catena-Arduino-Platform-filter-common.sh
#
# Function:
# This script must be sourced; it sets variables used by other
# scripts in this directory.
#
# Usage:
# source ci/Catena-Arduino-Platform-filter.sh
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# Ramasubbu, MCCI August 2021
#
##############################################################################

#### Capture the file path ####
MCCI_THISFILE="$0"

#### mandatory function: do the filtering
function _Catena-Arduino-Platform_filter {
declare -r CMD="$1"
shift
case "$CMD" in

# return 0 (success) if should process this sketch.
"process")
case "$MCCI_CI_ARCH:$(basename "$1")" in
# we need to skip this sketch until the SAMD
# bsp is updated; the Time library uses prog_read_ptr()
# which is broken in v2.3.0
"samd:catena_fsm.ino" | \
"samd:catena_hello.ino" | \
"samd:catena_hello_lora.ino" | \
"samd:catena_usercommand.ino")
return 1
;;
# some of the feather sketches fail on non-Feathers
"stm32:catena_fsm.ino" | \
"stm32:catena_hello.ino" | \
"stm32:catena_hello_lora.ino" | \
"stm32:catena_usercommand.ino")
return 1
;;
*)
return 0
;;
esac
;;
esac
}
26 changes: 26 additions & 0 deletions examples/catena_fsm/extra/ci/Catena-Arduino-Platform-filter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

##############################################################################
#
# Module: catena_fsm.ino/extra/ci/Catena-Arduino-Platform-filter.sh
#
# Function:
# This script must be sourced; it sets variables used by other
# scripts in this directory.
#
# Usage:
# source ci/Catena-Arduino-Platform-filter.sh
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# RamaSubbu, MCCI August 2021
#
##############################################################################

#### use the common code.
# shellcheck source=../../../../ci/Catena-Arduino-Platform-filter-common.sh
source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/Catena-Arduino-Platform-filter-common.sh

#### end of file ####
26 changes: 26 additions & 0 deletions examples/catena_hello/extra/ci/Catena-Arduino-Platform-filter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

##############################################################################
#
# Module: catena_hello.ino/extra/ci/Catena-Arduino-Platform-filter.sh
#
# Function:
# This script must be sourced; it sets variables used by other
# scripts in this directory.
#
# Usage:
# source ci/Catena-Arduino-Platform-filter.sh
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# RamaSubbu, MCCI August 2021
#
##############################################################################

#### use the common code.
# shellcheck source=../../../../ci/Catena-Arduino-Platform-filter-common.sh
source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/Catena-Arduino-Platform-filter-common.sh

#### end of file ####
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

##############################################################################
#
# Module: catena_hello_lora.ino/extra/ci/Catena-Arduino-Platform-filter.sh
#
# Function:
# This script must be sourced; it sets variables used by other
# scripts in this directory.
#
# Usage:
# source ci/Catena-Arduino-Platform-filter.sh
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# RamaSubbu, MCCI August 2021
#
##############################################################################

#### use the common code.
# shellcheck source=../../../../ci/Catena-Arduino-Platform-filter-common.sh
source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/Catena-Arduino-Platform-filter-common.sh

#### end of file ####
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

##############################################################################
#
# Module: catena_usercommand.ino/extra/ci/Catena-Arduino-Platform-filter.sh
#
# Function:
# This script must be sourced; it sets variables used by other
# scripts in this directory.
#
# Usage:
# source ci/Catena-Arduino-Platform-filter.sh
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# RamaSubbu, MCCI August 2021
#
##############################################################################

#### use the common code.
# shellcheck source=../../../../ci/Catena-Arduino-Platform-filter-common.sh
source "$(dirname "$MCCI_CI_FILTER_NAME")"/../../../../ci/Catena-Arduino-Platform-filter-common.sh

#### end of file ####

0 comments on commit 08b282d

Please sign in to comment.