Skip to content

Commit 209ab83

Browse files
authored
Switch CI to Github Actions. Resolve platformio#47 (platformio#48)
* Check github pythons * Try use tests * fix workflow * fix tox * use make test * fix workflow * log error in test 2.7 * try 2 * fix tests. Update get-platofrmio.py. Resolve platformio#47
1 parent 18d5d87 commit 209ab83

File tree

7 files changed

+54
-87
lines changed

7 files changed

+54
-87
lines changed

.appveyor.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, windows-latest, macos-latest]
11+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Check Python
20+
run: |
21+
python -V
22+
which python
23+
echo $PATH
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -U tox pytest
28+
pip install -e .
29+
- name: Python Lint
30+
run: |
31+
tox -e lint
32+
- name: Integration Tests
33+
run: |
34+
make test
35+
# - name: Slack Notification
36+
# uses: homoluctus/slatify@master
37+
# if: failure()
38+
# with:
39+
# type: ${{ job.status }}
40+
# job_name: '*Installer*'
41+
# commit: true
42+
# url: ${{ secrets.SLACK_BUILD_WEBHOOK }}

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

get-platformio.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pioinstaller/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def core_check(ctx, auto_upgrade, version_spec, dump_state):
106106
version_spec=version_spec,
107107
)
108108
if dump_state:
109-
core.dump_state(target=dump_state, state=state)
109+
core.dump_state(target=str(dump_state), state=state)
110110
click.secho(
111111
"Found compatible PlatformIO Core %s -> %s"
112112
% (state.get("core_version"), state.get("platformio_exe")),

tests/test_core.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,15 @@ def test_install_pio_core(pio_installer_script, tmpdir, monkeypatch):
3434
assert subprocess.check_call([python_exe, "-m", "platformio", "--version"]) == 0
3535

3636
core_state_path = os.path.join(str(core_dir), "core-state.json")
37-
assert (
38-
subprocess.check_call(
37+
assert subprocess.check_call(
3938
[
4039
"python",
4140
pio_installer_script,
4241
"check",
4342
"core",
4443
"--dump-state=%s" % core_state_path,
45-
]
46-
)
47-
== 0
48-
)
44+
], stderr=subprocess.STDOUT
45+
) == 0
4946
with open(core_state_path) as fp:
5047
json_info = json.load(fp)
5148
assert json_info.get("core_dir") == str(core_dir)

tox.ini

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Copyright 2019-present PlatformIO Labs <[email protected]>
22

33
[tox]
4-
envlist = py27, py37
4+
envlist = py27, py35, py36, py37, py38
55

66
[testenv]
77
usedevelop = True
88
deps =
9-
py36,py37: black
9+
py35,py36,py37,py38: black
1010
isort
1111
pylint
1212
pytest
13+
commands =
14+
{envpython} --version
15+
16+
[testenv:lint]
1317
commands =
1418
{envpython} --version
1519
pioinstaller --version
16-
pylint --rcfile=./.pylintrc ./pioinstaller
17-
# py.test --exitfirst tests
20+
pylint --rcfile=./.pylintrc ./pioinstaller

0 commit comments

Comments
 (0)