From 37c6f207470100479a8468a109c5c99b7a17774c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 19 May 2022 19:10:54 +0300 Subject: [PATCH] Test only popular dev-platforms --- .github/workflows/examples.yml | 22 ++++++++-------------- scripts/install_devplatforms.py | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6e9fc7df..4906bbaf 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,15 +7,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.7] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -23,26 +23,22 @@ jobs: python -m pip install --upgrade pip pip install tox + - name: Configure dev-platform installer + env: + PIO_INSTALL_DEVPLATFORM_OWNERNAMES: "platformio" + PIO_INSTALL_DEVPLATFORM_NAMES: "aceinna_imu,atmelavr,atmelmegaavr,atmelsam,espressif32,espressif8266,nordicnrf52,raspberrypi,ststm32,teensy" + - name: Run on Linux if: startsWith(matrix.os, 'ubuntu') - env: - PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio" - PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,intel_mcs51" run: | - # ChipKIT issue: install 32-bit support for GCC PIC32 - sudo apt-get install libc6-i386 # Free space sudo apt clean docker rmi $(docker image ls -aq) df -h - # Run tox -e testexamples - name: Run on macOS if: startsWith(matrix.os, 'macos') - env: - PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio" - PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,microchippic32,lattice_ice40,gd32v" run: | df -h tox -e testexamples @@ -52,8 +48,6 @@ jobs: env: PLATFORMIO_CORE_DIR: C:/pio PLATFORMIO_WORKSPACE_DIR: C:/pio-workspace/$PROJECT_HASH - PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio" - PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,riscv_gap" run: | tox -e testexamples diff --git a/scripts/install_devplatforms.py b/scripts/install_devplatforms.py index 80526d90..26b4a2ff 100644 --- a/scripts/install_devplatforms.py +++ b/scripts/install_devplatforms.py @@ -22,35 +22,38 @@ import click @click.command() @click.option("--desktop", is_flag=True, default=False) @click.option( - "--ignore", - envvar="PIO_INSTALL_DEVPLATFORMS_IGNORE", - help="Ignore names split by comma", + "--names", + envvar="PIO_INSTALL_DEVPLATFORM_NAMES", + help="Install specified platform (split by comma)", ) @click.option( "--ownernames", - envvar="PIO_INSTALL_DEVPLATFORMS_OWNERNAMES", - help="Filter dev-platforms by ownernames (split by comma)", + envvar="PIO_INSTALL_DEVPLATFORM_OWNERNAMES", + help="Filter by ownernames (split by comma)", ) -def main(desktop, ignore, ownernames): +def main(desktop, names, ownernames): platforms = json.loads( subprocess.check_output(["pio", "platform", "search", "--json-output"]).decode() ) - ignore = [n.strip() for n in (ignore or "").split(",") if n.strip()] + names = [n.strip() for n in (names or "").split(",") if n.strip()] ownernames = [n.strip() for n in (ownernames or "").split(",") if n.strip()] for platform in platforms: skip = [ not desktop and platform["forDesktop"], - platform["name"] in ignore, + names and platform["name"] not in names, ownernames and platform["ownername"] not in ownernames, ] if any(skip): continue + print(platform['name']) + continue subprocess.check_call( [ "pio", "pkg", "install", "--global", + "--skip-dependencies", "--platform", "{ownername}/{name}".format(**platform), ]