Test only popular dev-platforms

This commit is contained in:
Ivan Kravets
2022-05-19 19:10:54 +03:00
parent e27c1c39e4
commit 37c6f20747
2 changed files with 19 additions and 22 deletions

View File

@ -7,15 +7,15 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-18.04, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7] python-version: [3.7]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: "recursive" submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v3
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies
@ -23,26 +23,22 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install tox 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 - name: Run on Linux
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
env:
PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio"
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,intel_mcs51"
run: | run: |
# ChipKIT issue: install 32-bit support for GCC PIC32
sudo apt-get install libc6-i386
# Free space # Free space
sudo apt clean sudo apt clean
docker rmi $(docker image ls -aq) docker rmi $(docker image ls -aq)
df -h df -h
# Run
tox -e testexamples tox -e testexamples
- name: Run on macOS - name: Run on macOS
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
env:
PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio"
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,microchippic32,lattice_ice40,gd32v"
run: | run: |
df -h df -h
tox -e testexamples tox -e testexamples
@ -52,8 +48,6 @@ jobs:
env: env:
PLATFORMIO_CORE_DIR: C:/pio PLATFORMIO_CORE_DIR: C:/pio
PLATFORMIO_WORKSPACE_DIR: C:/pio-workspace/$PROJECT_HASH PLATFORMIO_WORKSPACE_DIR: C:/pio-workspace/$PROJECT_HASH
PIO_INSTALL_DEVPLATFORMS_OWNERNAMES: "platformio"
PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,riscv_gap"
run: | run: |
tox -e testexamples tox -e testexamples

View File

@ -22,35 +22,38 @@ import click
@click.command() @click.command()
@click.option("--desktop", is_flag=True, default=False) @click.option("--desktop", is_flag=True, default=False)
@click.option( @click.option(
"--ignore", "--names",
envvar="PIO_INSTALL_DEVPLATFORMS_IGNORE", envvar="PIO_INSTALL_DEVPLATFORM_NAMES",
help="Ignore names split by comma", help="Install specified platform (split by comma)",
) )
@click.option( @click.option(
"--ownernames", "--ownernames",
envvar="PIO_INSTALL_DEVPLATFORMS_OWNERNAMES", envvar="PIO_INSTALL_DEVPLATFORM_OWNERNAMES",
help="Filter dev-platforms by ownernames (split by comma)", help="Filter by ownernames (split by comma)",
) )
def main(desktop, ignore, ownernames): def main(desktop, names, ownernames):
platforms = json.loads( platforms = json.loads(
subprocess.check_output(["pio", "platform", "search", "--json-output"]).decode() 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()] ownernames = [n.strip() for n in (ownernames or "").split(",") if n.strip()]
for platform in platforms: for platform in platforms:
skip = [ skip = [
not desktop and platform["forDesktop"], not desktop and platform["forDesktop"],
platform["name"] in ignore, names and platform["name"] not in names,
ownernames and platform["ownername"] not in ownernames, ownernames and platform["ownername"] not in ownernames,
] ]
if any(skip): if any(skip):
continue continue
print(platform['name'])
continue
subprocess.check_call( subprocess.check_call(
[ [
"pio", "pio",
"pkg", "pkg",
"install", "install",
"--global", "--global",
"--skip-dependencies",
"--platform", "--platform",
"{ownername}/{name}".format(**platform), "{ownername}/{name}".format(**platform),
] ]