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

Enable CI #1

Merged
merged 1 commit into from
Jan 23, 2024
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
3 changes: 3 additions & 0 deletions .build-test-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usb/test_app:
enable:
- if: IDF_TARGET in ["esp32s2", "esp32s3"]
65 changes: 65 additions & 0 deletions .github/workflows/build_and_run_test_app_usb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and Run USB Test Application

on:
schedule:
- cron: '0 0 * * SAT' # Saturday midnight
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
name: Build USB Test App
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v4.4", "release-v5.0", "release-v5.1", "release-v5.2", "latest"]
runs-on: ubuntu-20.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Build USB Test Application
shell: bash
run: |
. ${IDF_PATH}/export.sh
pip install idf-component-manager idf-build-apps --upgrade
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
idf-build-apps find
idf-build-apps build
- uses: actions/upload-artifact@v2
with:
name: usb_test_app_bin_${{ matrix.idf_ver }}
path: |
usb/test_app/build_esp*/bootloader/bootloader.bin
usb/test_app/build_esp*/partition_table/partition-table.bin
usb/test_app/build_esp*/usb_test_app.bin
usb/test_app/build_esp*/usb_test_app.elf
usb/test_app/build_esp*/flasher_args.json

run-target:
name: Run USB Test App on target
if: ${{ github.repository_owner == 'espressif' }}
needs: build
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "latest"]
idf_target: ["esp32s2"]
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "usb_host"]
container:
image: python:3.7-buster
options: --privileged # Privileged mode has access to serial ports
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
with:
name: usb_test_app_bin_${{ matrix.idf_ver }}
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial
- name: Run USB Test App on target
run: pytest --target=${{ matrix.idf_target }} -m usb_host --build-dir=build_${{ matrix.idf_target }}
49 changes: 49 additions & 0 deletions .github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Push components to Espressif Component Service

on:
# For pull requests: perform upload with "--dry-run" argument,
# i.e. validate that the component passes all checks for being uploaded.
pull_request:

# For pushes to master: actually upload the components to the registry.
push:
branches:
- master

jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- run: |
echo "${{ ( github.ref_name != 'master' || github.repository_owner != 'espressif' ) && 'Checking' || 'Uploading' }} components"
- name: Upload components to component service
uses: espressif/upload-components-ci-action@v1
with:
# Please try to keep the directories list sorted.
#
# Do note, however, that if you are updating two components in the same PR
# and one depends on the other, the new version of the 2nd component won't
# be found in the registry when the 1st component is uploaded.
#
# This is only a problem if you are adding two components for the first time,
# or if the 2nd component depends on the exact (new) version of the first one.
#
directories: >
usb/esp_modem_usb_dte;
usb/esp_tinyusb;
usb/usb_host_cdc_acm;
usb/usb_host_ch34x_vcp;
usb/usb_host_cp210x_vcp;
usb/usb_host_ftdi_vcp;
usb/usb_host_hid;
usb/usb_host_msc;
usb/usb_host_uvc;
usb/usb_host_vcp;
namespace: "espressif"
# API token will only be available in the master branch in the main repository.
# However, dry-run doesn't require a valid token.
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
tore-espressif marked this conversation as resolved.
Show resolved Hide resolved
dry_run: ${{ github.ref_name != 'master' || github.repository_owner != 'espressif' }}
8 changes: 8 additions & 0 deletions .idf_build_apps.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target = "all"
paths = "usb/test_app"
recursive = true
manifest_file = ".build-test-rules.yml"
check_warnings = true

# build related options
build_dir = "build_@t"
6 changes: 1 addition & 5 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ addopts =

markers =
# target markers
esp32: support esp32 target
esp32s2: support esp32s2 target
esp32s3: support esp32s3 target
esp32c3: support esp32c3 target
esp32c2: support esp32c2 target
supported_targets: support all supported targets ('esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2')
supported_targets: support all supported targets ('esp32s2', 'esp32s3')

# env markers
generic: generic runner
usb_host: usb host runners
usb_device: usb device runners
ethernet: ethernet runners

# log related
log_cli = True
Expand Down
Loading