From 7c515346b28187ea1e2c418ee75e005e3eeacf6e Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 13:36:21 -0700 Subject: [PATCH 1/6] Initial GitHub workflow --- .circleci/.gitattributes | 1 - .circleci/.gitignore | 1 - .circleci/Makefile | 95 --- .circleci/README.md | 130 ---- .circleci/config.yml | 555 ------------------ .circleci/config/@config.yml | 1 - .circleci/config/commands/@commands.yml | 131 ----- .circleci/config/executors/@executors.yml | 30 - .circleci/config/jobs/build.yml | 25 - .circleci/config/jobs/code-coverage.yml | 21 - .circleci/config/jobs/deploy.yml | 18 - .circleci/config/jobs/examples_esp32.yml | 20 - .circleci/config/jobs/examples_nrf.yml | 20 - .circleci/config/jobs/examples_standalone.yml | 33 -- .circleci/config/jobs/test.yml | 52 -- .circleci/config/jobs/test_esp32_qemu.yml | 14 - .circleci/config/jobs/test_ipv6.yml | 20 - .circleci/config/workflows/Main.yml | 83 --- .github/workflows/build.yaml | 79 +++ .github/workflows/examples.yaml | 116 ++++ .github/workflows/qemu.yaml | 37 ++ examples/common/m5stack-tft/repo | 2 +- scripts/examples/esp_echo_app.sh | 3 + scripts/tests/inet_tests.sh | 14 +- scripts/tests/ipv6_container_tests.sh | 28 - scripts/tools/ipv6_container_setup.sh | 28 - third_party/openthread/repo | 2 +- 27 files changed, 238 insertions(+), 1321 deletions(-) delete mode 100644 .circleci/.gitattributes delete mode 100644 .circleci/.gitignore delete mode 100644 .circleci/Makefile delete mode 100644 .circleci/README.md delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/config/@config.yml delete mode 100644 .circleci/config/commands/@commands.yml delete mode 100644 .circleci/config/executors/@executors.yml delete mode 100644 .circleci/config/jobs/build.yml delete mode 100644 .circleci/config/jobs/code-coverage.yml delete mode 100644 .circleci/config/jobs/deploy.yml delete mode 100644 .circleci/config/jobs/examples_esp32.yml delete mode 100644 .circleci/config/jobs/examples_nrf.yml delete mode 100644 .circleci/config/jobs/examples_standalone.yml delete mode 100644 .circleci/config/jobs/test.yml delete mode 100644 .circleci/config/jobs/test_esp32_qemu.yml delete mode 100644 .circleci/config/jobs/test_ipv6.yml delete mode 100644 .circleci/config/workflows/Main.yml create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/examples.yaml create mode 100644 .github/workflows/qemu.yaml delete mode 100755 scripts/tests/ipv6_container_tests.sh delete mode 100755 scripts/tools/ipv6_container_setup.sh diff --git a/.circleci/.gitattributes b/.circleci/.gitattributes deleted file mode 100644 index 2dd06ee5f7cdb6..00000000000000 --- a/.circleci/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -config.yml linguist-generated diff --git a/.circleci/.gitignore b/.circleci/.gitignore deleted file mode 100644 index 3018b3a681324d..00000000000000 --- a/.circleci/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.tmp/ diff --git a/.circleci/Makefile b/.circleci/Makefile deleted file mode 100644 index c47f94ddd3d7ce..00000000000000 --- a/.circleci/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# Set SHELL to 'strict mode' without using .SHELLFLAGS for max compatibility. -# See https://fieldnotes.tech/how-to-shell-for-compatible-makefiles/ -SHELL := /usr/bin/env bash -euo pipefail -c - -# CONFIG is the name of the make target someone -# would invoke to update the main config file (config.yml). -CONFIG ?= ci-config -# VERIFY is the name of the make target someone -# would invoke to verify the config file. -VERIFY ?= ci-verify - -CIRCLECI := circleci --skip-update-check -ifeq ($(DEBUG_CIRCLECI_CLI),YES) -CIRCLECI += --debug -endif - -# For config processing, always refer to circleci.com not self-hosted circleci, -# because self-hosted does not currently support the necessary API. -CIRCLECI_CLI_HOST := https://circleci.com -export CIRCLECI_CLI_HOST - -# Set up some documentation/help message variables. -# We do not attempt to install the CircleCI CLI from this Makefile. -CCI_INSTALL_LINK := https://circleci.com/docs/2.0/local-cli/\#installation -CCI_INSTALL_MSG := Please install CircleCI CLI. See $(CCI_INSTALL_LINK) -CCI_VERSION := $(shell $(CIRCLECI) version 2> /dev/null) -ifeq ($(CCI_VERSION),) -# Attempting to use the CLI fails with installation instructions. -CIRCLECI := echo '$(CCI_INSTALL_MSG)'; exit 1; \# -endif - -SOURCE_DIR := config -SOURCE_YML := $(shell [ ! -d $(SOURCE_DIR) ] || find $(SOURCE_DIR) -name '*.yml') -CONFIG_SOURCE := Makefile $(SOURCE_YML) | $(SOURCE_DIR) -OUT := config.yml -TMP := .tmp/config-processed -CONFIG_PACKED := .tmp/config-packed - -default: help - -help: - @echo "Usage:" - @echo " make $(CONFIG): recompile config.yml from $(SOURCE_DIR)/" - @echo " make $(VERIFY): verify that config.yml is a true mapping from $(SOURCE_DIR)/" - @echo - @echo "Diagnostics:" - @[ -z "$(CCI_VERSION)" ] || echo " circleci-cli version $(CCI_VERSION)" - @[ -n "$(CCI_VERSION)" ] || echo " $(CCI_INSTALL_MSG)" - -$(SOURCE_DIR): - @echo No source directory $(SOURCE_DIR) found.; exit 1 - -# Make sure our .tmp dir exists. -$(shell [ -d .tmp ] || mkdir .tmp) - -.PHONY: $(CONFIG) -$(CONFIG): $(OUT) - -.PHONY: $(VERIFY) -$(VERIFY): config-up-to-date - @$(CIRCLECI) config validate $(OUT) - -define GENERATED_FILE_HEADER -### *** -### WARNING: DO NOT manually EDIT or MERGE this file, it is generated by 'make $(CONFIG)'. -### INSTEAD: Edit or merge the source in $(SOURCE_DIR)/ then run 'make $(CONFIG)'. -### *** -endef -export GENERATED_FILE_HEADER - -# GEN_CONFIG writes the config to a temporary file. If the whole process succeeds, -# it them moves that file to $@. This makes it an atomic operation, so if it fails -# make doesn't consider a half-baked file up to date. -define GEN_CONFIG - @$(CIRCLECI) config pack $(SOURCE_DIR) > $(CONFIG_PACKED) - @echo "$$GENERATED_FILE_HEADER" > $@.tmp || { rm -f $@; exit 1; } - @$(CIRCLECI) config process $(CONFIG_PACKED) >> $@.tmp || { rm -f $@.tmp; exit 1; } - @mv -f $@.tmp $@ -endef - -$(OUT): $(CONFIG_SOURCE) - $(GEN_CONFIG) - @echo "$@ updated" - -$(TMP): $(CONFIG_SOURCE) - $(GEN_CONFIG) - -.PHONY: config-up-to-date -config-up-to-date: $(TMP) # Note this must not depend on $(OUT)! - @if diff -w $(OUT) $<; then \ - echo "Generated $(OUT) is up to date!"; \ - else \ - echo "Generated $(OUT) is out of date, run make $(CONFIG) to update."; \ - exit 1; \ - fi diff --git a/.circleci/README.md b/.circleci/README.md deleted file mode 100644 index 1ec75cafade90f..00000000000000 --- a/.circleci/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# How to use CircleCI multi-file config - -This README and the Makefile should be in your `.circleci` directory, -in the root of your repository. -All path references in this README assume we are in this `.circleci` directory. - -The `Makefile` in this directory generates `./config.yml` in CircleCI 2.0 syntax, -from the tree rooted at `./config/`, which contains files in CircleCI 2.0 or 2.1 syntax. - - -## Quickstart - -The basic workflow is: - -- Edit source files in `./config/` -- When you are done, run `make ci-config` to update `./config.yml` -- Commit this entire `.circleci` directory, including that generated file together. -- Run `make ci-verify` to ensure the current `./config.yml` is up to date with the source. - -When merging this `.circleci` directory: - -- Do not merge the generated `./config.yml` file, instead: -- Merge the source files under `./config/`, and then -- Run `make ci-config` to re-generate the merged `./config.yml` - -And that's it, for more detail, read on! - - -## How does it work, roughly? - -CircleCI supports [generating a single config file from many], -using the `$ circleci config pack` command. -It also supports [expanding 2.1 syntax to 2.0 syntax] -using the `$ circleci config process` command. -We use these two commands, stitched together using the `Makefile` -to implement the workflow. - -[generating a single config file from many]: https://circleci.com/docs/2.0/local-cli/#packing-a-config -[expanding 2.1 syntax to 2.0 syntax]: https://circleci.com/docs/2.0/local-cli/#processing-a-config - - -## Prerequisites - -You will need the [CircleCI CLI tool] installed and working, -at least version `0.1.5607`. -You can [download this tool directly from GitHub Releases]. - -``` -$ circleci version -0.1.5607+f705856 -``` - -[CircleCI CLI tool]: https://circleci.com/docs/2.0/local-cli/ -[download this tool directly from GitHub Releases]: https://github.com/CircleCI-Public/circleci-cli/releases - - -## Updating the config source - -Before making changes, be sure to understand the layout -of the `./config/` file tree, as well as circleci 2.1 syntax. -See the [Syntax and layout] section below. - -To update the config, you should edit, add or remove files -in the `./config/` directory, -and then run `make ci-config`. -If that's successful, -you should then commit every `*.yml` file in the tree rooted in this directory. -That is: you should commit both the source under `./config/` -and the generated file `./config.yml` at the same time, in the same commit. -The included git pre-commit hook will help with this. -Do not edit the `./config.yml` file directly, as you will lose your changes -next time `make ci-config` is run. - -[Syntax and layout]: #syntax-and-layout - - -### Verifying `./config.yml` - -To check whether or not the current `./config.yml` is up to date with the source -and valid, run `$ make ci-verify`. -Note that `$ make ci-verify` should be run in CI, -in case not everyone has the git pre-commit hook set up correctly. - - -#### Example shell session - -```sh -$ make ci-config -config.yml updated -$ git add -A . # The -A makes sure to include deletions/renames etc. -$ git commit -m "ci: blah blah blah" -Changes detected in .circleci/, running 'make -C .circleci ci-verify' ---> Generated config.yml is up to date! ---> Config file at config.yml is valid. -``` - - -### Syntax and layout - -It is important to understand the layout of the config directory. -Read the documentation on [packing a config] for a full understanding -of how multiple YAML files are merged by the circleci CLI tool. - -[packing a config]: https://circleci.com/docs/2.0/local-cli/#packing-a-config - -Here is an example file tree (with comments added afterwards): - -```sh -$ tree . -. -├── Makefile -├── README.md # This file. -├── config # The source code for config.yml is rooted here. -│   ├── @config.yml # Files beginning with @ are treated specially by `circleci config pack` -│   ├── commands # Subdirectories of config become top-level keys. -│   │   └── go_test.yml # Filenames (minus .yml) become top-level keys under -│   │   └── go_build.yml # their parent (in this case "commands"). -│ │ # The contents of go_test.yml therefore are placed at: .commands.go_test: -│   └── jobs # jobs also becomes a top-level key under config... -│   ├── build.yml # ...and likewise filenames become keys under their parent. -│   └── test.yml -└── config.yml # The generated file in 2.0 syntax. -``` - -About those `@` files... Preceding a filename with `@` -indicates to `$ circleci config pack` that the contents of this YAML file -should be at the top-level, rather than underneath a key named after their filename. -This naming convention is unfortunate as it breaks autocompletion in bash, -but there we go. - diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4cc669861430d3..00000000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,555 +0,0 @@ -### *** -### WARNING: DO NOT manually EDIT or MERGE this file, it is generated by 'make ci-config'. -### INSTEAD: Edit or merge the source in config/ then run 'make ci-config'. -### *** -version: 2 -jobs: - Run Tests [mbedtls-build]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' --with-crypto=mbedtls' - - BUILD_TYPE: mbedtls-build - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-mbedtls-build-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-mbedtls-build-built - - restore_cache: - key: build-environment-{{ arch }}-mbedtls-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/tools/run_if.sh "mbedtls-build" "$BUILD_TYPE" scripts/tests/mbedtls_tests.sh - name: Run mbedTLS Tests - - run: - command: scripts/tools/run_if.sh "main-build mbedtls-build clang-build" "$BUILD_TYPE" scripts/tests/crypto_tests.sh - name: Run Crypto Tests - - run: - command: scripts/tools/run_if.sh "main-build ubuntu-16-lts clang-build" "$BUILD_TYPE" scripts/tests/setup_payload_tests.sh - name: Run Setup Payload Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/openssl_tests.sh - name: OpenSSL Tests - - run: - command: scripts/tools/run_if.sh "linux-embedded" "$BUILD_TYPE" make -C build/default/src/platform check - name: Run Platform Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/all_tests.sh - name: Run All Unit & Functional Tests - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs - Build Examples [nRF]: - docker: - - image: connectedhomeip/chip-build-nrf-platform:0.2.14 - environment: - - BUILD_TYPE: nrf-build - steps: - - checkout - - run: - command: scripts/examples/nrf_lock_app.sh - name: Build example nRF5 Lock App - - run: - command: | - mkdir -p example_binaries/nrf-build - cp examples/lock-app/nrf5/build/chip-nrf52840-lock-example.out \ - example_binaries/nrf-build/chip-nrf52840-lock-example.out - name: Preserve artifacts - - run: - command: | - mkdir -p "master_binaries/nrf-build" - scripts/helpers/bloat_check.py \ - --token "$CIRCLECI_API_TOKEN" \ - --job "Build Examples [nRF]" \ - --artifact-download-dir "master_binaries/nrf-build" \ - --build-output-dir "example_binaries/nrf-build" \ - --report-file bloat_report.txt \ - --github-repository "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" \ - --github-comment-pr-number "$CIRCLE_PR_NUMBER" \ - --github-api-token "$GITHUB_BLOAT_API_TOKEN" - name: Generate bloat report - - store_artifacts: - path: bloat_report.txt - - store_artifacts: - path: example_binaries/nrf-build - Deploy [main-build]: - docker: - - image: connectedhomeip/chip-build-openssl:0.2.14 - environment: - - BUILD_TYPE: main-build - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-main-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/build/distribution_check.sh - name: Deployment Check - Build Examples [main-build]: - docker: - - image: connectedhomeip/chip-build-openssl:0.2.14 - environment: - - BUILD_TYPE: main-build - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-main-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/examples/standalone_echo_client.sh - name: Build example Standalone Echo Client - - run: - command: scripts/examples/standalone_shell.sh - name: Build example Standalone Shell - - run: - command: | - mkdir -p example_binaries/main-build - cp examples/chip-tool/build/chip-standalone-demo.out \ - example_binaries/main-build/chip-standalone-demo.out - name: Preserve artifacts - - run: - command: | - mkdir -p "master_binaries/main-build" - scripts/helpers/bloat_check.py \ - --token "$CIRCLECI_API_TOKEN" \ - --job "Build Examples [main-build]" \ - --artifact-download-dir "master_binaries/main-build" \ - --build-output-dir "example_binaries/main-build" \ - --report-file bloat_report.txt \ - --github-repository "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" \ - --github-comment-pr-number "$CIRCLE_PR_NUMBER" \ - --github-api-token "$GITHUB_BLOAT_API_TOKEN" - name: Generate bloat report - - store_artifacts: - path: bloat_report.txt - - store_artifacts: - path: example_binaries/main-build - Run Tests [ESP32-QEMU]: - docker: - - image: connectedhomeip/chip-build-esp32-qemu:0.2.14 - environment: - - BUILD_TYPE: esp32-qemu-build - steps: - - checkout - - run: - command: scripts/tests/esp32_qemu_tests.sh - name: Build ESP32 QEMU and Run Tests - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs - Build CHIP [mbedtls-build]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' --with-crypto=mbedtls' - - BUILD_TYPE: mbedtls-build - steps: - - checkout - - restore_cache: - key: build-environment-{{ arch }}-mbedtls-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - save_cache: - key: build-environment-{{ arch }}-mbedtls-build-persistent-cache - paths: - - ./ci-cache-persistent - - run: - command: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS - name: Bootstrap - - save_cache: - key: bootstrapped-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-mbedtls-build-built - paths: - - . - - run: - command: scripts/build/default.sh - name: Build - - save_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-mbedtls-build-built - paths: - - . - - save_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-mbedtls-build-built - paths: - - build/downloads - Run Tests [linux-embedded]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' --with-device-layer=linux' - - BUILD_TYPE: linux-embedded - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-linux-embedded-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-linux-embedded-built - - restore_cache: - key: build-environment-{{ arch }}-linux-embedded-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/tools/run_if.sh "mbedtls-build" "$BUILD_TYPE" scripts/tests/mbedtls_tests.sh - name: Run mbedTLS Tests - - run: - command: scripts/tools/run_if.sh "main-build mbedtls-build clang-build" "$BUILD_TYPE" scripts/tests/crypto_tests.sh - name: Run Crypto Tests - - run: - command: scripts/tools/run_if.sh "main-build ubuntu-16-lts clang-build" "$BUILD_TYPE" scripts/tests/setup_payload_tests.sh - name: Run Setup Payload Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/openssl_tests.sh - name: OpenSSL Tests - - run: - command: scripts/tools/run_if.sh "linux-embedded" "$BUILD_TYPE" make -C build/default/src/platform check - name: Run Platform Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/all_tests.sh - name: Run All Unit & Functional Tests - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs - Build CHIP [linux-embedded]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' --with-device-layer=linux' - - BUILD_TYPE: linux-embedded - steps: - - checkout - - restore_cache: - key: build-environment-{{ arch }}-linux-embedded-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - save_cache: - key: build-environment-{{ arch }}-linux-embedded-persistent-cache - paths: - - ./ci-cache-persistent - - run: - command: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS - name: Bootstrap - - save_cache: - key: bootstrapped-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-linux-embedded-built - paths: - - . - - run: - command: scripts/build/default.sh - name: Build - - save_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-linux-embedded-built - paths: - - . - - save_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-linux-embedded-built - paths: - - build/downloads - Build CHIP [main-build]: - docker: - - image: connectedhomeip/chip-build-openssl:0.2.14 - environment: - - BUILD_TYPE: main-build - steps: - - checkout - - restore_cache: - key: build-environment-{{ arch }}-main-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - save_cache: - key: build-environment-{{ arch }}-main-build-persistent-cache - paths: - - ./ci-cache-persistent - - run: - command: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS - name: Bootstrap - - save_cache: - key: bootstrapped-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-main-build-built - paths: - - . - - run: - command: scripts/build/default.sh - name: Build - - save_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-main-build-built - paths: - - . - - save_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-main-build-built - paths: - - build/downloads - Build Examples [ESP32]: - docker: - - image: connectedhomeip/chip-build-esp32:0.2.14 - environment: - - BUILD_TYPE: esp32-build - steps: - - checkout - - run: - command: scripts/examples/esp_echo_app.sh - name: Build example Echo App - - run: - command: | - mkdir -p example_binaries/esp32-build - cp examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf \ - example_binaries/esp32-build/chip-wifi-echo.elf - name: Preserve artifacts - - run: - command: | - mkdir -p "master_binaries/esp32-build" - scripts/helpers/bloat_check.py \ - --token "$CIRCLECI_API_TOKEN" \ - --job "Build Examples [ESP32]" \ - --artifact-download-dir "master_binaries/esp32-build" \ - --build-output-dir "example_binaries/esp32-build" \ - --report-file bloat_report.txt \ - --github-repository "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" \ - --github-comment-pr-number "$CIRCLE_PR_NUMBER" \ - --github-api-token "$GITHUB_BLOAT_API_TOKEN" - name: Generate bloat report - - store_artifacts: - path: bloat_report.txt - - store_artifacts: - path: example_binaries/esp32-build - Run Tests [clang-build]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' CC=clang-9 CXX=clang++-9' - - BUILD_TYPE: clang-build - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-clang-build-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-clang-build-built - - restore_cache: - key: build-environment-{{ arch }}-clang-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/tools/run_if.sh "mbedtls-build" "$BUILD_TYPE" scripts/tests/mbedtls_tests.sh - name: Run mbedTLS Tests - - run: - command: scripts/tools/run_if.sh "main-build mbedtls-build clang-build" "$BUILD_TYPE" scripts/tests/crypto_tests.sh - name: Run Crypto Tests - - run: - command: scripts/tools/run_if.sh "main-build ubuntu-16-lts clang-build" "$BUILD_TYPE" scripts/tests/setup_payload_tests.sh - name: Run Setup Payload Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/openssl_tests.sh - name: OpenSSL Tests - - run: - command: scripts/tools/run_if.sh "linux-embedded" "$BUILD_TYPE" make -C build/default/src/platform check - name: Run Platform Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/all_tests.sh - name: Run All Unit & Functional Tests - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs - Build CHIP [clang-build]: - docker: - - image: connectedhomeip/chip-build:0.2.14 - environment: - - BOOTSTRAP_ARGUMENTS: ' CC=clang-9 CXX=clang++-9' - - BUILD_TYPE: clang-build - steps: - - checkout - - restore_cache: - key: build-environment-{{ arch }}-clang-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - save_cache: - key: build-environment-{{ arch }}-clang-build-persistent-cache - paths: - - ./ci-cache-persistent - - run: - command: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS - name: Bootstrap - - save_cache: - key: bootstrapped-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-clang-build-built - paths: - - . - - run: - command: scripts/build/default.sh - name: Build - - save_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-clang-build-built - paths: - - . - - save_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-clang-build-built - paths: - - build/downloads - Run Tests [main-build]: - docker: - - image: connectedhomeip/chip-build-openssl:0.2.14 - environment: - - BUILD_TYPE: main-build - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1}}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-{{ .Branch}}-{{.Environment.CIRCLE_SHA1 }}-main-build-built - - restore_cache: - key: build-environment-{{ arch }}-main-build-persistent-cache - - run: - command: scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo scripts/setup/linux/install_packages.sh - name: Setup Environment - - run: - command: scripts/tools/run_if.sh "mbedtls-build" "$BUILD_TYPE" scripts/tests/mbedtls_tests.sh - name: Run mbedTLS Tests - - run: - command: scripts/tools/run_if.sh "main-build mbedtls-build clang-build" "$BUILD_TYPE" scripts/tests/crypto_tests.sh - name: Run Crypto Tests - - run: - command: scripts/tools/run_if.sh "main-build ubuntu-16-lts clang-build" "$BUILD_TYPE" scripts/tests/setup_payload_tests.sh - name: Run Setup Payload Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/openssl_tests.sh - name: OpenSSL Tests - - run: - command: scripts/tools/run_if.sh "linux-embedded" "$BUILD_TYPE" make -C build/default/src/platform check - name: Run Platform Tests - - run: - command: scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" scripts/tests/all_tests.sh - name: Run All Unit & Functional Tests - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs - Run Tests [IPv6]: - machine: - image: ubuntu-1604:201903-01 - environment: - - BUILD_TYPE: ipv6-tests - steps: - - checkout - - run: - command: scripts/tools/ipv6_container_setup.sh - name: Config Docker container - - run: - command: scripts/tests/ipv6_container_tests.sh - name: Run tests in the Docker container - - run: - command: scripts/tests/save_logs.sh /tmp/test_logs - name: Save test log files - when: on_fail - - store_artifacts: - path: /tmp/test_logs -workflows: - Main: - jobs: - - Build CHIP [main-build]: - filters: - branches: - ignore: - - /restyled.*/ - - Build CHIP [mbedtls-build]: - filters: - branches: - ignore: - - /restyled.*/ - - Build CHIP [clang-build]: - filters: - branches: - ignore: - - /restyled.*/ - - Build CHIP [linux-embedded]: - filters: - branches: - ignore: - - /restyled.*/ - - Run Tests [main-build]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [main-build] - - Run Tests [mbedtls-build]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [mbedtls-build] - - Run Tests [clang-build]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [clang-build] - - Run Tests [linux-embedded]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [linux-embedded] - - Run Tests [ESP32-QEMU]: - filters: - branches: - ignore: - - /restyled.*/ - - Run Tests [IPv6]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [main-build] - - Deploy [main-build]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Run Tests [main-build] - - Build Examples [nRF]: - filters: - branches: - ignore: - - /restyled.*/ - - Build Examples [ESP32]: - filters: - branches: - ignore: - - /restyled.*/ - - Build Examples [main-build]: - filters: - branches: - ignore: - - /restyled.*/ - requires: - - Build CHIP [main-build] - version: 2 diff --git a/.circleci/config/@config.yml b/.circleci/config/@config.yml deleted file mode 100644 index 3879be90472abb..00000000000000 --- a/.circleci/config/@config.yml +++ /dev/null @@ -1 +0,0 @@ -version: 2.1 diff --git a/.circleci/config/commands/@commands.yml b/.circleci/config/commands/@commands.yml deleted file mode 100644 index 8244f0245c0552..00000000000000 --- a/.circleci/config/commands/@commands.yml +++ /dev/null @@ -1,131 +0,0 @@ -bootstrap: - description: Bootstrap the source tree - parameters: - builder: - type: string - steps: - - run: - name: Bootstrap - command: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS -save-persistent-ci-cache: - description: Save persistent CI Cache - parameters: - builder: - type: string - steps: - - save_cache: - key: build-environment-{{ arch - }}-<>-persistent-cache - paths: - - ./ci-cache-persistent -load-persistent-ci-cache: - description: Load persistent CI Cache - parameters: - builder: - type: string - steps: - - restore_cache: - key: build-environment-{{ arch - }}-<>-persistent-cache -save-build-environment: - description: Save the build environment - parameters: - builder: - type: string - steps: - - save_cache: - key: build-environment-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1 }}-<< - parameters.builder>>-built - paths: - - build/downloads -save-bootstrapped-tree: - description: Save the bootstrapped tree - parameters: - builder: - type: string - steps: - - save_cache: - key: bootstrapped-tree-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1 }}-<< - parameters.builder>>-built - paths: - - . -load-bootstrapped-tree: - description: Load the bootstrapped tree - parameters: - builder: - type: string - steps: - - restore_cache: - key: bootstrapped-tree-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1 }}-<< - parameters.builder>>-built -save-built-tree: - description: Save the built tree - parameters: - builder: - type: string - steps: - - save_cache: - key: built-tree-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1}}-<< - parameters.builder>>-built - paths: - - . -load-build-environment: - description: Load the build environment - parameters: - builder: - type: string - steps: - - restore_cache: - key: build-environment-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1 }}-<< - parameters.builder>>-built -load-built-tree: - description: Load the built tree - parameters: - builder: - type: string - steps: - - restore_cache: - key: built-tree-{{ arch }}-{{ - .Branch}}-{{.Environment.CIRCLE_SHA1}}-<< - parameters.builder>>-built -setup-environment: - description: Setup Environment - parameters: - builder: - type: string - steps: - - run: - name: Setup Environment - command: - scripts/tools/run_if.sh "ubuntu-16-lts" "$BUILD_TYPE" sudo - scripts/setup/linux/install_packages.sh -bloat-check: - description: Bloat check against master branch - parameters: - job_name: - type: string - baseline_download_dir: - type: string - build_output_dir: - type: string - steps: - - run: - name: Generate bloat report - command: | - mkdir -p "<>" - scripts/helpers/bloat_check.py \ - --token "$CIRCLECI_API_TOKEN" \ - --job "<>" \ - --artifact-download-dir "<>" \ - --build-output-dir "<>" \ - --report-file bloat_report.txt \ - --github-repository "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" \ - --github-comment-pr-number "$CIRCLE_PR_NUMBER" \ - --github-api-token "$GITHUB_BLOAT_API_TOKEN" - - store_artifacts: - path: bloat_report.txt diff --git a/.circleci/config/executors/@executors.yml b/.circleci/config/executors/@executors.yml deleted file mode 100644 index f6c833e936da2f..00000000000000 --- a/.circleci/config/executors/@executors.yml +++ /dev/null @@ -1,30 +0,0 @@ -main-build: - docker: - - image: connectedhomeip/chip-build-openssl:0.2.14 -nrf-build: - docker: - - image: connectedhomeip/chip-build-nrf-platform:0.2.14 -esp32-build: - docker: - - image: connectedhomeip/chip-build-esp32:0.2.14 -esp32-qemu-build: - docker: - - image: connectedhomeip/chip-build-esp32-qemu:0.2.14 -linux-embedded: - environment: - BOOTSTRAP_ARGUMENTS: " --with-device-layer=linux" - docker: - - image: connectedhomeip/chip-build:0.2.14 -mbedtls-build: - environment: - BOOTSTRAP_ARGUMENTS: " --with-crypto=mbedtls" - docker: - - image: connectedhomeip/chip-build:0.2.14 -clang-build: - environment: - BOOTSTRAP_ARGUMENTS: " CC=clang-9 CXX=clang++-9" - docker: - - image: connectedhomeip/chip-build:0.2.14 -ipv6-tests: - machine: - image: ubuntu-1604:201903-01 diff --git a/.circleci/config/jobs/build.yml b/.circleci/config/jobs/build.yml deleted file mode 100644 index 0f01c5ed065847..00000000000000 --- a/.circleci/config/jobs/build.yml +++ /dev/null @@ -1,25 +0,0 @@ -parameters: - builder: - type: string -environment: - BUILD_TYPE: "<< parameters.builder >>" -executor: << parameters.builder >> -steps: - - checkout - - load-persistent-ci-cache: - builder: << parameters.builder >> - - setup-environment: - builder: << parameters.builder >> - - save-persistent-ci-cache: - builder: << parameters.builder >> - - bootstrap: - builder: << parameters.builder >> - - save-bootstrapped-tree: - builder: << parameters.builder >> - - run: - name: Build - command: scripts/build/default.sh - - save-built-tree: - builder: << parameters.builder >> - - save-build-environment: - builder: << parameters.builder >> diff --git a/.circleci/config/jobs/code-coverage.yml b/.circleci/config/jobs/code-coverage.yml deleted file mode 100644 index 61d8951ad5bdb3..00000000000000 --- a/.circleci/config/jobs/code-coverage.yml +++ /dev/null @@ -1,21 +0,0 @@ -parameters: - builder: - type: string -environment: - BUILD_TYPE: << parameters.builder >> -executor: << parameters.builder >> -steps: - - load-built-tree: - builder: << parameters.builder >> - - load-build-environment: - builder: << parameters.builder >> - - load-persistent-ci-cache: - builder: << parameters.builder >> - - setup-environment: - builder: << parameters.builder >> - - run: - name: Run Code Coverage - command: scripts/tools/codecoverage.sh - - run: - name: Upload Code Coverage - command: bash <(curl -s https://codecov.io/bash) diff --git a/.circleci/config/jobs/deploy.yml b/.circleci/config/jobs/deploy.yml deleted file mode 100644 index 2ce88f990a08db..00000000000000 --- a/.circleci/config/jobs/deploy.yml +++ /dev/null @@ -1,18 +0,0 @@ -parameters: - builder: - type: string -environment: - BUILD_TYPE: << parameters.builder >> -executor: << parameters.builder >> -steps: - - load-built-tree: - builder: << parameters.builder >> - - load-build-environment: - builder: << parameters.builder >> - - load-persistent-ci-cache: - builder: << parameters.builder >> - - setup-environment: - builder: << parameters.builder >> - - run: - name: Deployment Check - command: scripts/build/distribution_check.sh diff --git a/.circleci/config/jobs/examples_esp32.yml b/.circleci/config/jobs/examples_esp32.yml deleted file mode 100644 index bef056ed04193b..00000000000000 --- a/.circleci/config/jobs/examples_esp32.yml +++ /dev/null @@ -1,20 +0,0 @@ -environment: - BUILD_TYPE: esp32-build -executor: esp32-build -steps: - - checkout - - run: - name: Build example Echo App - command: scripts/examples/esp_echo_app.sh - - run: - name: Preserve artifacts - command: | - mkdir -p example_binaries/esp32-build - cp examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf \ - example_binaries/esp32-build/chip-wifi-echo.elf - - bloat-check: - job_name: Build Examples [ESP32] - baseline_download_dir: master_binaries/esp32-build - build_output_dir: example_binaries/esp32-build - - store_artifacts: - path: example_binaries/esp32-build diff --git a/.circleci/config/jobs/examples_nrf.yml b/.circleci/config/jobs/examples_nrf.yml deleted file mode 100644 index 4a50e755bb4958..00000000000000 --- a/.circleci/config/jobs/examples_nrf.yml +++ /dev/null @@ -1,20 +0,0 @@ -environment: - BUILD_TYPE: nrf-build -executor: nrf-build -steps: - - checkout - - run: - name: Build example nRF5 Lock App - command: scripts/examples/nrf_lock_app.sh - - run: - name: Preserve artifacts - command: | - mkdir -p example_binaries/nrf-build - cp examples/lock-app/nrf5/build/chip-nrf52840-lock-example.out \ - example_binaries/nrf-build/chip-nrf52840-lock-example.out - - bloat-check: - job_name: Build Examples [nRF] - baseline_download_dir: master_binaries/nrf-build - build_output_dir: example_binaries/nrf-build - - store_artifacts: - path: example_binaries/nrf-build diff --git a/.circleci/config/jobs/examples_standalone.yml b/.circleci/config/jobs/examples_standalone.yml deleted file mode 100644 index f0dfb46e17cea5..00000000000000 --- a/.circleci/config/jobs/examples_standalone.yml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - builder: - type: string -environment: - BUILD_TYPE: "<< parameters.builder >>" -executor: << parameters.builder >> -steps: - - load-built-tree: - builder: << parameters.builder >> - - load-build-environment: - builder: << parameters.builder >> - - load-persistent-ci-cache: - builder: << parameters.builder >> - - setup-environment: - builder: << parameters.builder >> - - run: - name: Build example Standalone Echo Client - command: scripts/examples/standalone_echo_client.sh - - run: - name: Build example Standalone Shell - command: scripts/examples/standalone_shell.sh - - run: - name: Preserve artifacts - command: | - mkdir -p example_binaries/<> - cp examples/chip-tool/build/chip-standalone-demo.out \ - example_binaries/<>/chip-standalone-demo.out - - bloat-check: - job_name: Build Examples [<>] - baseline_download_dir: master_binaries/<> - build_output_dir: example_binaries/<> - - store_artifacts: - path: example_binaries/<> diff --git a/.circleci/config/jobs/test.yml b/.circleci/config/jobs/test.yml deleted file mode 100644 index ee32074dff402d..00000000000000 --- a/.circleci/config/jobs/test.yml +++ /dev/null @@ -1,52 +0,0 @@ -parameters: - builder: - type: string - run_setup_payload_tests: - type: boolean - default: true -environment: - BUILD_TYPE: << parameters.builder >> -executor: << parameters.builder >> -steps: - - load-built-tree: - builder: << parameters.builder >> - - load-build-environment: - builder: << parameters.builder >> - - load-persistent-ci-cache: - builder: << parameters.builder >> - - setup-environment: - builder: << parameters.builder >> - - run: - name: Run mbedTLS Tests - command: scripts/tools/run_if.sh "mbedtls-build" "$BUILD_TYPE" - scripts/tests/mbedtls_tests.sh - - run: - name: Run Crypto Tests - command: - scripts/tools/run_if.sh "main-build mbedtls-build clang-build" - "$BUILD_TYPE" scripts/tests/crypto_tests.sh - - run: - name: Run Setup Payload Tests - command: - scripts/tools/run_if.sh "main-build ubuntu-16-lts clang-build" - "$BUILD_TYPE" scripts/tests/setup_payload_tests.sh - - run: - name: OpenSSL Tests - command: - scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" - scripts/tests/openssl_tests.sh - - run: - name: Run Platform Tests - command: scripts/tools/run_if.sh "linux-embedded" "$BUILD_TYPE" - make -C build/default/src/platform check - - run: - name: Run All Unit & Functional Tests - command: - scripts/tools/run_if.sh "main-build clang-build" "$BUILD_TYPE" - scripts/tests/all_tests.sh - - run: - name: Save test log files - command: scripts/tests/save_logs.sh /tmp/test_logs - when: on_fail - - store_artifacts: - path: /tmp/test_logs diff --git a/.circleci/config/jobs/test_esp32_qemu.yml b/.circleci/config/jobs/test_esp32_qemu.yml deleted file mode 100644 index 67a3b738cbe2eb..00000000000000 --- a/.circleci/config/jobs/test_esp32_qemu.yml +++ /dev/null @@ -1,14 +0,0 @@ -environment: - BUILD_TYPE: esp32-qemu-build -executor: esp32-qemu-build -steps: - - checkout - - run: - name: Build ESP32 QEMU and Run Tests - command: scripts/tests/esp32_qemu_tests.sh - - run: - name: Save test log files - command: scripts/tests/save_logs.sh /tmp/test_logs - when: on_fail - - store_artifacts: - path: /tmp/test_logs diff --git a/.circleci/config/jobs/test_ipv6.yml b/.circleci/config/jobs/test_ipv6.yml deleted file mode 100644 index c48023877face3..00000000000000 --- a/.circleci/config/jobs/test_ipv6.yml +++ /dev/null @@ -1,20 +0,0 @@ -parameters: - builder: - type: string -environment: - BUILD_TYPE: ipv6-tests -executor: ipv6-tests -steps: - - checkout - - run: - name: Config Docker container - command: scripts/tools/ipv6_container_setup.sh - - run: - name: Run tests in the Docker container - command: scripts/tests/ipv6_container_tests.sh - - run: - name: Save test log files - command: scripts/tests/save_logs.sh /tmp/test_logs - when: on_fail - - store_artifacts: - path: /tmp/test_logs diff --git a/.circleci/config/workflows/Main.yml b/.circleci/config/workflows/Main.yml deleted file mode 100644 index 3a9cd246290a78..00000000000000 --- a/.circleci/config/workflows/Main.yml +++ /dev/null @@ -1,83 +0,0 @@ -jobs: - - build: - name: Build CHIP [<< matrix.builder >>] - matrix: - parameters: - builder: ["main-build", "mbedtls-build", "clang-build", "linux-embedded"] - filters: - branches: - ignore: - - /restyled.*/ - - test: - name: Run Tests [<< matrix.builder >>] - matrix: - parameters: - builder: ["main-build", "mbedtls-build", "clang-build", "linux-embedded"] - requires: - - Build CHIP [<< matrix.builder >>] - filters: - branches: - ignore: - - /restyled.*/ - - test_esp32_qemu: - name: Run Tests [ESP32-QEMU] - filters: - branches: - ignore: - - /restyled.*/ - - test_ipv6: - name: Run Tests [IPv6] - matrix: - parameters: - builder: ["main-build"] - requires: - - Build CHIP [<< matrix.builder >>] - filters: - branches: - ignore: - - /restyled.*/ - # - code-coverage: - # name: Code Coverage [<< matrix.builder >>] - # matrix: - # parameters: - # builder: ["main-build"] - # requires: - # - Build CHIP [<< matrix.builder >>] - # filters: - # branches: - # ignore: - # - /restyled.*/ - - deploy: - name: Deploy [<< matrix.builder >>] - matrix: - parameters: - builder: ["main-build"] - requires: - - Run Tests [<< matrix.builder >>] - filters: - branches: - ignore: - - /restyled.*/ - - examples_nrf: - name: Build Examples [nRF] - filters: - branches: - ignore: - - /restyled.*/ - - examples_esp32: - name: Build Examples [ESP32] - filters: - branches: - ignore: - - /restyled.*/ - - examples_standalone: - name: Build Examples [<< matrix.builder >>] - matrix: - parameters: - builder: ["main-build"] - requires: - - Build CHIP [<< matrix.builder >>] - filters: - branches: - ignore: - - /restyled.*/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000000000..2ac1805483b637 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,79 @@ +name: Builds + +on: + push: + pull_request: + +jobs: + build: + name: Build + + strategy: + matrix: + type: [main, clang, linux-embedded, mbedtls] + env: + BUILD_TYPE: ${{ matrix.type }} + BUILD_VERSION: 0.2.14 + BUILD_IMAGE: chip-build-openssl + BUILD_ORG: connectedhomeip + + runs-on: ubuntu-latest + + container: + image: "connectedhomeip/chip-build-openssl:0.2.14" + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Build Type + run: | + case $BUILD_TYPE in + "main") export BOOTSTRAP_ARGUMENTS="";; + "clang") export BOOTSTRAP_ARGUMENTS="CC=clang-9 CXX=clang++-9";; + "linux-embedded") export BOOTSTRAP_ARGUMENTS="--with-device-layer=linux";; + "mbedtls") export BOOTSTRAP_ARGUMENTS="--with-crypto=mbedtls";; + *) ;; + esac + + - name: Bootstrap + run: scripts/build/bootstrap.sh $BOOTSTRAP_ARGUMENTS + - name: Run Build + run: scripts/build/default.sh + - name: Run mbedTLS Tests + if: ${{ contains('mbedtls', env.BUILD_TYPE) }} + run: scripts/tests/mbedtls_tests.sh + - name: Run Crypto Tests + if: ${{ contains('mbedtls,clang,main', env.BUILD_TYPE) }} + run: scripts/tests/crypto_tests.sh + - name: Run Setup Payload Tests + if: ${{ contains('main,clang', env.BUILD_TYPE) }} + run: scripts/tests/setup_payload_tests.sh + - name: OpenSSL Tests + if: ${{ contains('main,clang', env.BUILD_TYPE) }} + run: scripts/tests/openssl_tests.sh + - name: Run Embedded Platform Tests + if: ${{ contains('linux-embedded', env.BUILD_TYPE) }} + run: make -C build/default/src/platform check + - name: Run Network Tests + run: scripts/tests/inet_tests.sh + - name: Run All Unit & Functional Tests + if: ${{ contains('main,clang', env.BUILD_TYPE) }} + run: scripts/tests/all_tests.sh + - name: Copying Logs Aside + run: scripts/tests/save_logs.sh /tmp/test_logs + - name: Uploading Logs + uses: actions/upload-artifact@v1 + with: + name: ${{ env.BUILD_TYPE }}-logs + path: /tmp/log_output + - name: Deployment Check + # if: ${{ contains('main', env.BUILD_TYPE) }} + run: scripts/build/distribution_check.sh + # - name: Run Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: scripts/tools/codecoverage.sh + # - name: Upload Code Coverage + # if: ${{ contains('main', env.BUILD_TYPE) }} + # run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml new file mode 100644 index 00000000000000..954a0924e10fc3 --- /dev/null +++ b/.github/workflows/examples.yaml @@ -0,0 +1,116 @@ +name: Examples + +on: + push: + pull_request: + +jobs: + esp32: + name: ESP32 + + env: + BUILD_TYPE: esp32 + BUILD_VERSION: 0.2.14 + BUILD_IMAGE: chip-build-esp32 + BUILD_ORG: connectedhomeip + + runs-on: ubuntu-latest + + container: + image: connectedhomeip/chip-build-esp32:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + - "/tmp/output_binaries:/tmp/output_binaries" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build example Echo App + run: scripts/examples/esp_echo_app.sh + - name: Copy aside build products + run: + mkdir -p example_binaries/$BUILD_TYPE-build; cp + examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf example_binaries/$BUILD_TYPE-build/chip-wifi-echo.elf + + # - name: Generate bloat report + # run: | + # mkdir -p "master_binaries/esp32-build" + # scripts/helpers/bloat_check.py \ + # --token "$GITHUB_TOKEN" \ + # --job "$GITHUB_WORKFLOW" \ + # --artifact-download-dir "master_binaries/$BUILD_TYPE-build" \ + # --build-output-dir "example_binaries/$BUILD_TYPE-build" \ + # --report-file bloat_report.txt \ + # --github-repository "$GITHUB_REPOSITORY" \ + # --github-comment-pr-number "$CIRCLE_PR_NUMBER" + - name: Copy aside bloat report & binaries + run: | + cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/ + # cp bloat_report.txt /tmp/bloat_reports/ + # - name: Uploading Bloat Report + # uses: actions/upload-artifact@v1 + # with: + # name: ${{ env.BUILD_TYPE }}-bloat-report + # path: /tmp/bloat_reports/bloat_report.txt + - name: Uploading Binaries + uses: actions/upload-artifact@v1 + with: + name: ${{ env.BUILD_TYPE }}-example-build + path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build + + nrf: + name: nRF + + env: + BUILD_TYPE: nrf + BUILD_VERSION: 0.2.14 + BUILD_IMAGE: chip-build-nrf-platform + BUILD_ORG: connectedhomeip + + runs-on: ubuntu-latest + + container: + image: connectedhomeip/chip-build-nrf-platform:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + - "/tmp/output_binaries:/tmp/output_binaries" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build example nRF5 Lock App + run: scripts/examples/nrf_lock_app.sh + - name: Preserve artifacts + run: + mkdir -p example_binaries/nrf-build ; cp + examples/lock-app/nrf5/build/chip-nrf52840-lock-example.out example_binaries/nrf-build/chip-nrf52840-lock-example.out + + linux-standalone: + name: Linux Standalone + + env: + BUILD_TYPE: linux + BUILD_VERSION: 0.2.14 + BUILD_IMAGE: chip-build + BUILD_ORG: connectedhomeip + + runs-on: ubuntu-latest + + container: + image: connectedhomeip/chip-build:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + - "/tmp/output_binaries:/tmp/output_binaries" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build example Standalone Echo Client + run: scripts/examples/standalone_echo_client.sh + - name: Build example Standalone Shell + run: scripts/examples/standalone_shell.sh + - name: Preserve artifacts + run: | + mkdir -p example_binaries/$BUILD_TYPE + cp examples/chip-tool/build/chip-standalone-demo.out \ + example_binaries/$BUILD_TYPE/chip-standalone-demo.out diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml new file mode 100644 index 00000000000000..9353713cb6a20a --- /dev/null +++ b/.github/workflows/qemu.yaml @@ -0,0 +1,37 @@ +name: QEMU + +on: + push: + pull_request: + +jobs: + examples: + name: ESP32 + + env: + BUILD_TYPE: esp32-qemu + BUILD_VERSION: 0.2.14 + BUILD_IMAGE: chip-build-esp32-qemu + BUILD_ORG: connectedhomeip + + runs-on: ubuntu-latest + + container: + image: connectedhomeip/chip-build-esp32-qemu:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + volumes: + - "/tmp/log_output:/tmp/test_logs" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build example Echo App + run: scripts/examples/esp_echo_app.sh + - name: Build ESP32 QEMU and Run Tests + run: scripts/tests/esp32_qemu_tests.sh + - name: Save test log files + run: scripts/tests/save_logs.sh /tmp/test_logs + - name: Uploading Logs + uses: actions/upload-artifact@v1 + with: + name: qemu-esp32-logs + path: /tmp/log_output diff --git a/examples/common/m5stack-tft/repo b/examples/common/m5stack-tft/repo index 3a841faacb218d..35be9760b4edf4 160000 --- a/examples/common/m5stack-tft/repo +++ b/examples/common/m5stack-tft/repo @@ -1 +1 @@ -Subproject commit 3a841faacb218dbdba2f54edb251d3a64d9833fb +Subproject commit 35be9760b4edf485287f78c0cf652beb19c047f0 diff --git a/scripts/examples/esp_echo_app.sh b/scripts/examples/esp_echo_app.sh index 9e011cffed02c1..077ca76c0d52c0 100755 --- a/scripts/examples/esp_echo_app.sh +++ b/scripts/examples/esp_echo_app.sh @@ -19,6 +19,9 @@ set -x env +ls -la /var/ +ls -la /var/esp-idf/ + root=examples/wifi-echo/server/esp32/ make -j -f Makefile-bootstrap repos diff --git a/scripts/tests/inet_tests.sh b/scripts/tests/inet_tests.sh index 5cc19a14e19ac3..762a00ac9b47ba 100755 --- a/scripts/tests/inet_tests.sh +++ b/scripts/tests/inet_tests.sh @@ -19,16 +19,4 @@ set -x env -here=$(cd "$(dirname "$0")" && pwd) -CHIPDIR="$here"/../.. -cd "$CHIPDIR" - -mkdir -p build/default -cd build/default -"$CHIPDIR"/bootstrap-configure - -make V=1 -C src/include - -# Currently, only running inet tests -# More/other tests can be added for IPV6 here. -make V=1 -C src/inet check +make V=1 -C build/default/src/inet check diff --git a/scripts/tests/ipv6_container_tests.sh b/scripts/tests/ipv6_container_tests.sh deleted file mode 100755 index d247e035ad62ef..00000000000000 --- a/scripts/tests/ipv6_container_tests.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set -x -env - -here=$(cd "$(dirname "$0")" && pwd) -CHIPDIR="$here"/../.. -cd "$CHIPDIR" - -dockerfile_version=$(cat "$CHIPDIR"/integrations/docker/images/chip-build/version) -docker run --rm -v "$PWD":/workspaces/connectedhomeip connectedhomeip/chip-build:"$dockerfile_version" \ - /workspaces/connectedhomeip/scripts/tests/inet_tests.sh diff --git a/scripts/tools/ipv6_container_setup.sh b/scripts/tools/ipv6_container_setup.sh deleted file mode 100755 index 4c5eae9d39956c..00000000000000 --- a/scripts/tools/ipv6_container_setup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set -x - -cat <<'EOF' | sudo tee /etc/docker/daemon.json -{ - "ipv6": true, - "fixed-cidr-v6": "2001:db8:1::/64" -} -EOF - -sudo service docker restart diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 9e291e62ed92d1..ce9040950eff60 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 9e291e62ed92d1132467489c4483330c46c0bce4 +Subproject commit ce9040950eff60014e91a0a6adbaf1ccc1532fe5 From e8aa6a9387f8ef5dbdeccc7875e0d387df346c3d Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 20:50:28 +0000 Subject: [PATCH 2/6] Removing debug ls --- scripts/examples/esp_echo_app.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/examples/esp_echo_app.sh b/scripts/examples/esp_echo_app.sh index 077ca76c0d52c0..9e011cffed02c1 100755 --- a/scripts/examples/esp_echo_app.sh +++ b/scripts/examples/esp_echo_app.sh @@ -19,9 +19,6 @@ set -x env -ls -la /var/ -ls -la /var/esp-idf/ - root=examples/wifi-echo/server/esp32/ make -j -f Makefile-bootstrap repos From 764c1803d03ba371dc0319eac7ce5c0a4e78dc6a Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 14:23:02 -0700 Subject: [PATCH 3/6] Trying to revert to previous submodule --- examples/common/m5stack-tft/repo | 2 +- third_party/openthread/repo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/common/m5stack-tft/repo b/examples/common/m5stack-tft/repo index 35be9760b4edf4..3a841faacb218d 160000 --- a/examples/common/m5stack-tft/repo +++ b/examples/common/m5stack-tft/repo @@ -1 +1 @@ -Subproject commit 35be9760b4edf485287f78c0cf652beb19c047f0 +Subproject commit 3a841faacb218dbdba2f54edb251d3a64d9833fb diff --git a/third_party/openthread/repo b/third_party/openthread/repo index ce9040950eff60..9e291e62ed92d1 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit ce9040950eff60014e91a0a6adbaf1ccc1532fe5 +Subproject commit 9e291e62ed92d1132467489c4483330c46c0bce4 From 5073acbbea941c0ad70fe54af4e845e079ad64e1 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 14:53:20 -0700 Subject: [PATCH 4/6] Testing Pull Approve Changes --- .pullapprove.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pullapprove.yml b/.pullapprove.yml index 8238c54b77e463..257ccb26e23bb8 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -15,6 +15,13 @@ pullapprove_conditions: unmet_status: "failure" explanation: "Style must be inline before reviewing can be complete" + ############################################################ + # Builds + ############################################################ + - condition: "'Build (clang)' in statuses.successful" + unmet_status: "failure" + explanation: "Clang build needs to pass" + ############################################################ # License Checks ############################################################ From 7aa10a98de66a24021c54738e7cb62459dbd24da Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 15:01:11 -0700 Subject: [PATCH 5/6] Removing this for now --- .pullapprove.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 257ccb26e23bb8..8238c54b77e463 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -15,13 +15,6 @@ pullapprove_conditions: unmet_status: "failure" explanation: "Style must be inline before reviewing can be complete" - ############################################################ - # Builds - ############################################################ - - condition: "'Build (clang)' in statuses.successful" - unmet_status: "failure" - explanation: "Clang build needs to pass" - ############################################################ # License Checks ############################################################ From 23e31114f28458289a7605a856defa24f61e69e1 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 2 Jul 2020 16:01:46 -0700 Subject: [PATCH 6/6] Updating status badges --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bd10503285d986..3a3cb89abc2868 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Connected Home over IP -[![project-chip](https://circleci.com/gh/project-chip/connectedhomeip.svg?style=shield&circle-token=7318eddc58468689cd2ae9c5c82fe8dcf24902f6)](https://app.circleci.com/pipelines/github/project-chip/connectedhomeip?branch=master) +![Main](https://github.com/project-chip/connectedhomeip/workflows/Builds/badge.svg) +![Examples](https://github.com/project-chip/connectedhomeip/workflows/Examples/badge.svg) +![QEMU](https://github.com/project-chip/connectedhomeip/workflows/QEMU/badge.svg) # What is Project Connected Home over IP?