Added workflow to test qmk cli setup on OSX, Linux and MSYS2
This commit is contained in:
committed by
skullydazed
parent
6a0e62a078
commit
db0b8cb9a0
@@ -0,0 +1,76 @@
|
||||
name: CLI Setup
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths:
|
||||
- 'qmk_cli/**'
|
||||
- 'milc.py'
|
||||
- 'qmk'
|
||||
- 'requirements.txt'
|
||||
- '.github/workflows/setup_and_doctor.yml'
|
||||
- 'setup.cfg'
|
||||
- 'setup.py'
|
||||
|
||||
jobs:
|
||||
test_cli_nix:
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
QMK_HOME: ~/qmk_firmware
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest]
|
||||
python-version: [3.5, 3.6, 3.7, 3.8]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install python dependencies
|
||||
run: |
|
||||
python -m pip install wheel
|
||||
echo "::add-path::$HOME/.local/bin"
|
||||
|
||||
- name: Install QMK CLI from source
|
||||
run: |
|
||||
python3 -m pip install -r requirements.txt
|
||||
python setup.py sdist bdist_wheel
|
||||
cd ..
|
||||
python3 -m pip install --force-reinstall --no-index --no-deps --prefix=~/.local --find-links qmk_cli/dist qmk
|
||||
|
||||
- name: Run qmk setup -y
|
||||
run: qmk setup -y
|
||||
|
||||
test_cli_win:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.5, 3.8]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up MSYS2
|
||||
uses: qmk/setup-msys2@v1
|
||||
with:
|
||||
update: true
|
||||
|
||||
- name: (MSYS2) Install git and python3
|
||||
run: msys2do pacman -S git python3-pip --noconfirm
|
||||
|
||||
- name: (MSYS2) Upgrade pip and setuptools and install wheel
|
||||
run: |
|
||||
msys2do python3 -m pip install --upgrade pip setuptools
|
||||
msys2do python3 -m pip install wheel
|
||||
|
||||
- name: (MSYS2) Install QMK CLI from source
|
||||
run: msys2do quantum/setup_msys.sh $(cygpath "${{ github.workspace }}")
|
||||
|
||||
- name: (MSYS2) Run qmk setup -y
|
||||
run: msys2do qmk setup -y
|
||||
@@ -35,7 +35,7 @@ def setup(cli):
|
||||
# Run `qmk_firmware/bin/qmk doctor` to check the rest of the environment out
|
||||
if qmk_firmware.exists():
|
||||
qmk_bin = qmk_firmware / 'bin' / 'qmk'
|
||||
doctor = subprocess.run([sys.executable, qmk_bin, 'doctor'])
|
||||
doctor = subprocess.run([sys.executable, str(qmk_bin), 'doctor'])
|
||||
if doctor.returncode != 0:
|
||||
cli.log.error('Your build environment is not setup completely.')
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp -r $1 ~/qmk_cli
|
||||
|
||||
export PATH=~/.local/bin:$PATH
|
||||
echo "PATH=$PATH" >> ~/.bashrc
|
||||
|
||||
export QMK_HOME=~/qmk_firmware
|
||||
export CLI_DIR=~/qmk_cli
|
||||
|
||||
cd $CLI_DIR
|
||||
python3 -m pip install -r requirements.txt
|
||||
python3 setup.py sdist bdist_wheel
|
||||
cd ~
|
||||
python3 -m pip install --force-reinstall --no-index --no-deps --prefix=~/.local --find-links qmk_cli/dist qmk
|
||||
Reference in New Issue
Block a user