diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..78bbd76 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: "Test" + +on: [push, pull_request] + +jobs: + build: + name: ${{ matrix.board }} ${{ matrix.framework_opts }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 2 + matrix: + framework_opts: + - "type=esp-idf version=recommended platform_version=5.4.0" + - "type=arduino version=recommended platform_version=5.4.0" + board: + - esp32-c3-devkitm-1 + - wt32-eth01 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Configure + run: ${{matrix.framework_opts}} board=${{matrix.board}} envsubst < test/config.yaml.template > test/config.yaml + - name: Compile + uses: esphome/build-action@v4.0.4 + id: esphome-build + with: + yaml-file: test/config.yaml diff --git a/docker_build.sh b/docker_build.sh new file mode 100755 index 0000000..9357905 --- /dev/null +++ b/docker_build.sh @@ -0,0 +1,7 @@ +set -x +#FRAMEWORK_OPTS="-s type arduino -s version recommended -s platform_version 5.4.0" +#FRAMEWORK_OPTS="-s type esp-idf -s version 5.2.1 -s platform_version 6.7.0" +FRAMEWORK_OPTS="-s type esp-idf -s version recommended -s platform_version 5.4.0" +BOARD="-s board esp32-c3-devkitm-1" +docker run --mount type=bind,source=$(pwd),target=/config -it esphome/esphome $FRAMEWORK_OPTS $BOARD compile test/config.yaml.template + diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 0000000..d8b4157 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,5 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +/secrets.yaml diff --git a/test/config.yaml.template b/test/config.yaml.template new file mode 100644 index 0000000..bdf7851 --- /dev/null +++ b/test/config.yaml.template @@ -0,0 +1,28 @@ +external_components: + - source: ../components + +esp32: + framework: + type: ${type} + version: ${version} + platform_version: ${platform_version} + board: ${board} + +logger: + level: VERBOSE + +esphome: + name: "test-node" + +wifi: + power_save_mode: none + networks: + - ssid: ssid + password: password + +api: + +canbus: + platform: canbus_udp_multicast + id: can_bus + can_id: 1