mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Test only popular dev-platforms
This commit is contained in:
22
.github/workflows/examples.yml
vendored
22
.github/workflows/examples.yml
vendored
@ -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
|
||||
|
||||
|
@ -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),
|
||||
]
|
||||
|
Reference in New Issue
Block a user