Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel environments for ESP32* in Docker Containers #1

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/container-build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: "esp32 container build check"

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
esp32s3-container-build:
name: "esp32s3: container-build"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Test building container esp32s3"
run: |
set -euxo pipefail
cd ${{ github.workspace }}/esp32s3
# config 1
docker build -f Dockerfile.esp32s3_fuseblower \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg IDF_SDKCONFIG=sdkconfig.dev-sbv2_nojtag \
.
# config 2
docker build -f Dockerfile.esp32s3_fuseblower \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg IDF_SDKCONFIG=sdkconfig.dev-sbv2_withjtag \
.
# config 3
docker build -f Dockerfile.esp32s3_fuseblower \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg IDF_SDKCONFIG=sdkconfig.dev-sbv2-fe_withjtag \
.

esp32s2-container-build-fuseblower:
name: "esp32s2: container-build - fuseblower"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Test building fuse blower container esp32s2fb"
run: |
set -euxo pipefail
cd ${{ github.workspace }}/esp32s2
# Build using a SBV2 enabling sdkconfig
docker build -f Dockerfile.esp32s2_fuseblower \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg IDF_SDKCONFIG=sdkconfig.sbv2_nojtag \
.

esp32s2-container-build-zephyr:
name: "esp32s2: container-build - zephyr/mcuboot"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Test building container esp32s2zephyr"
run: |
set -euxo pipefail
cd ${{ github.workspace }}/esp32s2
docker build -f Dockerfile.esp32s2_zephyr \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg MCUBOOT_PRIVATE_KEY="mcuboot-ecdsa-p256_private_dev.pem" \
--build-arg BOOTLOADER_CONFIG="bootloader_mcuboot_dev.conf" \
.

esp32-container-build-fuseblower:
name: "esp32: container-build - fuseblower"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Test building fuse blower container esp32s2fb"
run: |
set -euxo pipefail
cd ${{ github.workspace }}/esp32
# Build using a SBV2 enabling sdkconfig
docker build -f Dockerfile.esp32_fuseblower \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg IDF_SDKCONFIG=sdkconfig.sbv2_nojtag \
.

esp32-container-build-zephyr:
name: "esp32: container-build - zephyr/mcuboot"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Test building container esp32zephyr"
run: |
set -euxo pipefail
cd ${{ github.workspace }}/esp32
docker build -f Dockerfile.esp32_mcuboot_zephyr \
--build-arg SBV2_PRIVATE_KEY="sbv2_private_dev.pem" \
--build-arg MCUBOOT_PRIVATE_KEY="mcuboot-ecdsa-p256_private_dev.pem" \
--build-arg BOOTLOADER_CONFIG="bootloader_mcuboot_dev.conf" \
.
37 changes: 37 additions & 0 deletions .github/workflows/pub-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Reusable workflow.
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
name: "Publish to GHCR"
on:
workflow_call:
inputs:
source_image_tag:
required: true
type: string
target_image_tag:
required: true
type: string
docker_build_cmd:
required: true
type: string
jobs:
publish-container:
name: "publish container"
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Build container"
run: |
set -euxo pipefail
cd ${{ github.workspace }}
eval "${{ inputs.docker_build_cmd }}"
# Publish container image to GitHub Container Registry (GHCR)
- name: "publish to ghcr.io"
run: |
set -euxo pipefail
cd ${{ github.workspace }}
GHCR_URI="ghcr.io"
GHCR_IMAGE_URI="${GHCR_URI}/${{ github.repository_owner }}/${{ inputs.target_image_tag }}"
echo "${{ secrets.GITHUB_TOKEN }}" | docker login "${GHCR_URI}" -u ${{ github.actor }} --password-stdin
docker tag "${{ inputs.source_image_tag }}" "${GHCR_IMAGE_URI}"
docker push "${GHCR_IMAGE_URI}"
52 changes: 52 additions & 0 deletions .github/workflows/publish-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "publish esp32 containers"

on:
push:
paths-ignore:
- '**/README.md'
- '**/img/**'
- 'CODEOWNERS'
- '**/data/**'
branches:
- 'main'

jobs:
esp32s3-idf-publish-container:
# Reusable workflow can be used only at job (but not step) level
uses: ./.github/workflows/pub-ghcr.yml
with:
source_image_tag: "esp32s3_idf:latest"
target_image_tag: "esp32s3_idf:${GITHUB_SHA}"
docker_build_cmd: "cd esp32s3 && docker build -f Dockerfile.esp32s3_fuseblower -t esp32s3_idf:latest --build-arg SBV2_PRIVATE_KEY=sbv2_private_dev.pem --build-arg IDF_SDKCONFIG=sdkconfig.dev-sbv2_nojtag ."

esp32s2-fuseblower-publish-container:
# Reusable workflow can be used only at job (but not step) level
uses: ./.github/workflows/pub-ghcr.yml
with:
source_image_tag: "esp32s2_fuseblower:latest"
target_image_tag: "esp32s2_fuseblower:${GITHUB_SHA}"
docker_build_cmd: "cd esp32s2 && docker build -f Dockerfile.esp32s2_fuseblower -t esp32s2_fuseblower:latest --build-arg SBV2_PRIVATE_KEY=sbv2_private_dev.pem --build-arg IDF_SDKCONFIG=sdkconfig.sbv2_nojtag ."

esp32s2-zephyr-publish-container:
# Reusable workflow can be used only at job (but not step) level
uses: ./.github/workflows/pub-ghcr.yml
with:
source_image_tag: "esp32s2_zephyr:latest"
target_image_tag: "esp32s2_zephyr:${GITHUB_SHA}"
docker_build_cmd: "cd esp32s2 && docker build -f Dockerfile.esp32s2_zephyr -t esp32s2_zephyr:latest --build-arg SBV2_PRIVATE_KEY=sbv2_private_dev.pem --build-arg MCUBOOT_PRIVATE_KEY=mcuboot-ecdsa-p256_private_dev.pem --build-arg BOOTLOADER_CONFIG=bootloader_mcuboot_dev.conf ."

esp32-fuseblower-publish-container:
# Reusable workflow can be used only at job (but not step) level
uses: ./.github/workflows/pub-ghcr.yml
with:
source_image_tag: "esp32_fuseblower:latest"
target_image_tag: "esp32_fuseblower:${GITHUB_SHA}"
docker_build_cmd: "cd esp32 && docker build -f Dockerfile.esp32_fuseblower -t esp32_fuseblower:latest --build-arg SBV2_PRIVATE_KEY=sbv2_private_dev.pem --build-arg IDF_SDKCONFIG=sdkconfig.sbv2_nojtag ."

esp32-zephyr-publish-container:
# Reusable workflow can be used only at job (but not step) level
uses: ./.github/workflows/pub-ghcr.yml
with:
source_image_tag: "esp32_zephyr:latest"
target_image_tag: "esp32_zephyr:${GITHUB_SHA}"
docker_build_cmd: "cd esp32 && docker build -f Dockerfile.esp32_mcuboot_zephyr -t esp32_zephyr:latest --build-arg SBV2_PRIVATE_KEY=sbv2_private_dev.pem --build-arg MCUBOOT_PRIVATE_KEY=mcuboot-ecdsa-p256_private_dev.pem --build-arg BOOTLOADER_CONFIG=bootloader_mcuboot_dev.conf ."
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Thistle Technologies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading