mirror of
https://github.com/kk7ds/chirp
synced 2026-08-13 17:51:36 -04:00
Merge pull request #44 from kk7ds/split-tests
Split tests and fix py3 PR actions
This commit is contained in:
commit
83a70ea2a2
5 changed files with 91 additions and 28 deletions
29
.github/actions/py2-tox/action.yaml
vendored
Normal file
29
.github/actions/py2-tox/action.yaml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
name: Python2 tox runner
|
||||
description: Runs tox py2 targets
|
||||
inputs:
|
||||
tox_target:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get remove -y python3-libxml2
|
||||
sudo apt-get install -y libxml2-dev python-dev python-libxml2
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
python get-pip.py
|
||||
pip --version
|
||||
python -m pip install --upgrade --no-deps --force-reinstall lxml
|
||||
python -m pip install \
|
||||
future \
|
||||
pep8 \
|
||||
pyserial \
|
||||
tox
|
||||
- name: Run tox
|
||||
shell: bash
|
||||
run: |
|
||||
tox -e ${{ inputs.tox_target }}
|
||||
53
.github/workflows/py2-test.yaml
vendored
Normal file
53
.github/workflows/py2-test.yaml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: Tests
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
style:
|
||||
name: Style checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Run tox
|
||||
uses: ./.github/actions/py2-tox
|
||||
with:
|
||||
tox_target: style
|
||||
|
||||
unit:
|
||||
name: Unit tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Run tox
|
||||
uses: ./.github/actions/py2-tox
|
||||
with:
|
||||
tox_target: unit
|
||||
|
||||
driver:
|
||||
name: Driver tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Run tox
|
||||
uses: ./.github/actions/py2-tox
|
||||
with:
|
||||
tox_target: driver
|
||||
|
||||
matrix:
|
||||
name: Create support matrix
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Run tox
|
||||
uses: ./.github/actions/py2-tox
|
||||
with:
|
||||
tox_target: makesupported
|
||||
- name: Archive support matrix
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: support-matrix
|
||||
path: model_support.html
|
||||
8
.github/workflows/py3-pr.yaml
vendored
8
.github/workflows/py3-pr.yaml
vendored
|
|
@ -18,15 +18,17 @@ jobs:
|
|||
git checkout origin/py3 -b py3-sync
|
||||
git config --global user.email "bot@chirp.danplanet.com"
|
||||
git config --global user.name "Merge Bot"
|
||||
git merge $GITHUB_SHA --allow-unrelated-histories --no-edit
|
||||
git merge $GITHUB_SHA --allow-unrelated-histories --no-edit || {
|
||||
git add -u
|
||||
git commit --no-edit
|
||||
}
|
||||
git checkout -b auto-py3-$GITHUB_SHA
|
||||
git push origin auto-py3-$GITHUB_SHA:auto-py3-$GITHUB_SHA
|
||||
- name: Create PR
|
||||
uses: repo-sync/pull-request@v2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_token: ${{ secrets.PR_SYNC }}
|
||||
source_branch: auto-py3-${{ github.sha }}
|
||||
destination_branch: py3
|
||||
pr_title: "[Automated] Sync master with py3"
|
||||
pr_body: "Automated pull request to sync py3 with changes from master"
|
||||
pr_reviewer: "kk7ds"
|
||||
|
|
|
|||
25
.github/workflows/test.yaml
vendored
25
.github/workflows/test.yaml
vendored
|
|
@ -1,25 +0,0 @@
|
|||
name: Test
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
test:
|
||||
name: Run all tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get remove -y python3-libxml2
|
||||
sudo apt-get install -y libxml2-dev python-dev python-libxml2
|
||||
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
|
||||
python get-pip.py
|
||||
pip --version
|
||||
python -m pip install --upgrade --no-deps --force-reinstall lxml
|
||||
python -m pip install \
|
||||
future \
|
||||
pep8 \
|
||||
pyserial \
|
||||
tox
|
||||
- run: tox
|
||||
4
tox.ini
4
tox.ini
|
|
@ -28,3 +28,7 @@ deps =
|
|||
future
|
||||
commands =
|
||||
python ./tools/cpep8.py
|
||||
|
||||
[testenv:makesupported]
|
||||
commands =
|
||||
python share/make_supported.py model_support.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue