diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 955b9aca..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,31 +0,0 @@ -build: off - -platform: - - x64 - -environment: - matrix: - - TOXENV: "py27" - PLATFORMIO_BUILD_CACHE_DIR: C:\Temp\PIO_Build_Cache_P2_{build} - PYTHON_DIRS: C:\Python27-x64;C:\Python27-x64\Scripts - - - TOXENV: "py36" - PLATFORMIO_BUILD_CACHE_DIR: C:\Temp\PIO_Build_Cache_P3_{build} - PYTHON_DIRS: C:\Python36-x64;C:\Python36-x64\Scripts - -install: - - cmd: git submodule update --init --recursive - - cmd: SET PATH=%PYTHON_DIRS%;C:\MinGW\bin;%PATH% - - cmd: SET PLATFORMIO_CORE_DIR=C:\.pio - - cmd: pip install --force-reinstall tox - -test_script: - - cmd: tox - -notifications: - - provider: Slack - incoming_webhook: - secure: E9H0SU0Ju7WLDvgxsV8cs3J62T3nTTX7QkEjsczN0Sto/c9hWkVfhc5gGWUkxhlD975cokHByKGJIdwYwCewqOI+7BrcT8U+nlga4Uau7J8= - on_build_success: false - on_build_failure: true - on_build_status_changed: true diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml new file mode 100644 index 00000000..9d8a57fc --- /dev/null +++ b/.github/workflows/core.yml @@ -0,0 +1,42 @@ +name: Core + +on: [push] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [2.7, 3.7] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + git submodule update --init --recursive + python -m pip install --upgrade pip + pip install tox + + - name: Python Lint + run: | + tox -e lint + - name: Integration Tests + env: + PLATFORMIO_TEST_ACCOUNT_LOGIN: ${{ secrets.PLATFORMIO_TEST_ACCOUNT_LOGIN }} + PLATFORMIO_TEST_ACCOUNT_PASSWORD: ${{ secrets.PLATFORMIO_TEST_ACCOUNT_PASSWORD }} + run: | + tox -e testcore + + - name: Slack Notification + uses: homoluctus/slatify@master + if: failure() + with: + type: ${{ job.status }} + job_name: '*Core*' + commit: true + url: ${{ secrets.SLACK_BUILD_WEBHOOK }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..491728a5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,31 @@ +name: Docs + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install dependencies + run: | + git submodule update --init --recursive + python -m pip install --upgrade pip + pip install tox + + - name: Build docs + run: | + tox -e docs + + - name: Slack Notification + uses: homoluctus/slatify@master + if: failure() + with: + type: ${{ job.status }} + job_name: '*Docs*' + commit: true + url: ${{ secrets.SLACK_BUILD_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 00000000..b5d18772 --- /dev/null +++ b/.github/workflows/examples.yml @@ -0,0 +1,65 @@ +name: Examples + +on: [push] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, windows-latest, macos-latest] + python-version: [2.7, 3.7] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + git submodule update --init --recursive + python -m pip install --upgrade pip + pip install tox + + - name: Run on Linux + if: startsWith(matrix.os, 'ubuntu') + env: + PLATFORMIO_BUILD_CACHE_DIR: /tmp/pio + PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,intel_mcs51,aceinna_imu" + 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: + PLATFORMIO_BUILD_CACHE_DIR: /tmp/pio + PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,microchippic32,gd32v,nuclei" + run: | + df -h + tox -e testexamples + + - name: Run on Windows + if: startsWith(matrix.os, 'windows') + env: + PLATFORMIO_CORE_DIR: C:/pio + PLATFORMIO_BUILD_CACHE_DIR: C:/pio/tmp + PIO_INSTALL_DEVPLATFORMS_IGNORE: "ststm8,infineonxmc,riscv_gap" + run: | + tox -e testexamples + + - name: Slack Notification + uses: homoluctus/slatify@master + if: failure() + with: + type: ${{ job.status }} + job_name: '*Examples*' + commit: true + url: ${{ secrets.SLACK_BUILD_WEBHOOK }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e4b65227..00000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -language: python - -matrix: - include: - - os: linux - sudo: false - python: 2.7 - env: TOX_ENV=docs - - os: linux - sudo: required - python: 2.7 - env: TOX_ENV=py27 PLATFORMIO_BUILD_CACHE_DIR=$(mktemp -d) - - os: linux - sudo: required - python: 3.6 - env: TOX_ENV=py36 PLATFORMIO_BUILD_CACHE_DIR=$(mktemp -d) - - os: osx - language: generic - env: TOX_ENV=skipexamples - -install: - - git submodule update --init --recursive - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -fsSL https://bootstrap.pypa.io/get-pip.py | sudo python; fi - - pip install -U tox - - # ChipKIT issue: install 32-bit support for GCC PIC32 - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libc6-i386; fi - -script: - - tox -e $TOX_ENV - -notifications: - email: false - - slack: - rooms: - secure: JD6VGfN4+SLU2CwDdiIOr1VgwD+zbYUCE/srwyGuHavnjIkPItkl6T6Bn8Y4VrU6ysbuKotfdV2TAJJ82ivFbY8BvZBc7FBcYp/AGQ4FaCCV5ySv8RDAcQgdE12oaGzMdODiLqsB85f65zOlAFa+htaXyEiRTcotn6Y2hupatrI= - on_failure: always - on_success: change diff --git a/README.rst b/README.rst index 0122741d..44c251e0 100644 --- a/README.rst +++ b/README.rst @@ -1,12 +1,15 @@ PlatformIO ========== -.. image:: https://travis-ci.org/platformio/platformio-core.svg?branch=develop - :target: https://travis-ci.org/platformio/platformio-core - :alt: Travis.CI Build Status -.. image:: https://ci.appveyor.com/api/projects/status/unnpw0n3c5k14btn/branch/develop?svg=true - :target: https://ci.appveyor.com/project/ivankravets/platformio-core - :alt: AppVeyor.CI Build Status +.. image:: https://github.com/platformio/platformio-core/workflows/Core/badge.svg + :target: https://docs.platformio.org/page/core/index.html + :alt: CI Build for PlatformIO Core +.. image:: https://github.com/platformio/platformio-core/workflows/Examples/badge.svg + :target: https://github.com/platformio/platformio-examples + :alt: CI Build for dev-platform examples +.. image:: https://github.com/platformio/platformio-core/workflows/Docs/badge.svg + :target: https://docs.platformio.org?utm_source=github&utm_medium=core + :alt: CI Build for Docs .. image:: https://img.shields.io/pypi/v/platformio.svg :target: https://pypi.python.org/pypi/platformio/ :alt: Latest Version @@ -45,13 +48,13 @@ PlatformIO Get Started ----------- -* `What is PlatformIO? `_ +* `What is PlatformIO? `_ Instruments ----------- * `PlatformIO IDE `_ -* `PlatformIO Core (CLI) `_ +* `PlatformIO Core (CLI) `_ * `Library Management `_ * `Project Examples `__ * `Desktop IDEs Integration `_ @@ -64,7 +67,7 @@ Professional * `PIO Check `_ * `PIO Remote `_ * `PIO Unified Debugger `_ -* `PIO Unit Testing `_ +* `PIO Unit Testing `_ Registry -------- @@ -140,8 +143,8 @@ Telemetry / Privacy Policy Share minimal diagnostics and usage information to help us make PlatformIO better. It is enabled by default. For more information see: -* `Telemetry Setting `_ -* `SSL Setting `_ +* `Telemetry Setting `_ +* `SSL Setting `_ License ------- diff --git a/scripts/install_devplatforms.py b/scripts/install_devplatforms.py index a7a2668e..7252be69 100644 --- a/scripts/install_devplatforms.py +++ b/scripts/install_devplatforms.py @@ -15,26 +15,29 @@ import json import subprocess import sys -from platformio import util + +import click -def main(): +@click.command() +@click.option("--desktop", is_flag=True, default=False) +@click.option( + "--ignore", + envvar="PIO_INSTALL_DEVPLATFORMS_IGNORE", + help="Ignore names split by comma", +) +def main(desktop, ignore): platforms = json.loads( subprocess.check_output( - ["platformio", "platform", "search", "--json-output"]).decode()) + ["platformio", "platform", "search", "--json-output"] + ).decode() + ) + ignore = [n.strip() for n in (ignore or "").split(",") if n.strip()] for platform in platforms: - if platform['forDesktop']: + skip = [not desktop and platform["forDesktop"], platform["name"] in ignore] + if any(skip): continue - # RISC-V GAP does not support Windows 86 - if (util.get_systype() == "windows_x86" - and platform['name'] == "riscv_gap"): - continue - # unknown issue on Linux - if ("linux" in util.get_systype() - and platform['name'] == "aceinna_imu"): - continue - subprocess.check_call( - ["platformio", "platform", "install", platform['name']]) + subprocess.check_call(["platformio", "platform", "install", platform["name"]]) if __name__ == "__main__": diff --git a/tests/test_examples.py b/tests/test_examples.py index ea271460..c9f64c18 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -36,14 +36,6 @@ def pytest_generate_tests(metafunc): # dev/platforms for manifest in PlatformManager().get_installed(): p = PlatformFactory.newPlatform(manifest["__pkg_dir"]) - ignore_conds = [ - not p.is_embedded(), - p.name in ("ststm8", "infineonxmc"), - # issue with "version `CXXABI_1.3.9' not found (required by sdcc)" - "linux" in util.get_systype() and p.name == "intel_mcs51", - ] - if any(ignore_conds): - continue examples_dir = join(p.get_dir(), "examples") assert isdir(examples_dir) examples_dirs.append(examples_dir) @@ -70,7 +62,6 @@ def pytest_generate_tests(metafunc): metafunc.parametrize("pioproject_dir", sorted(project_dirs)) -@pytest.mark.examples def test_run(pioproject_dir): with util.cd(pioproject_dir): config = ProjectConfig() diff --git a/tox.ini b/tox.ini index fc31f45e..2c972c9f 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # limitations under the License. [tox] -envlist = py27, py35, py36, py37, docs +envlist = py27,py37 [testenv] passenv = * @@ -25,13 +25,23 @@ deps = pytest pytest-xdist jsondiff +commands = + {envpython} --version + +[testenv:lint] commands = {envpython} --version pylint --rcfile=./.pylintrc ./platformio - {envpython} -c "print('travis_fold:start:install_devplatforms')" + +[testenv:testcore] +commands = + {envpython} --version + py.test -v --basetemp="{envtmpdir}" tests --ignore tests/test_examples.py + +[testenv:testexamples] +commands = {envpython} scripts/install_devplatforms.py - {envpython} -c "print('travis_fold:end:install_devplatforms')" - py.test -v --basetemp="{envtmpdir}" tests + py.test -v --basetemp="{envtmpdir}" tests/test_examples.py [testenv:docs] deps = @@ -48,16 +58,3 @@ deps = sphinx_rtd_theme commands = sphinx-build -W -b linkcheck docs docs/_build/html - -[testenv:skipexamples] -commands = - py.test -v --basetemp="{envtmpdir}" tests --ignore tests/test_examples.py - -; [testenv:coverage] -; basepython = python2 -; passenv = * -; deps = -; pytest -; pytest-cov -; commands = -; py.test --cov=platformio --cov-report term --cov-report xml --ignore=tests/test_examples.py --ignore=tests/test_pkgmanifest.py -v tests