Add a build checker script #82
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dev Build | |
on: | |
push: | |
branches-ignore: | |
- master | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
dev-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
include: | |
- os: windows-latest | |
pio_lib_path: D:\a\Get_started, D:\a\Get_started\luos_engine\tool_services | |
- os: macos-latest | |
pio_lib_path: /home/runner/work/Get_started, /home/runner/work/Get_started/luos_engine/tool_services | |
- os: ubuntu-latest | |
pio_lib_path: /home/runner/work/Get_started, /home/runner/work/Get_started/luos_engine/tool_services | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install platformio | |
npm install -g [email protected] | |
- name: Check out getting started repository | |
uses: actions/checkout@v2 | |
- name: Check for code format | |
if: ${{ runner.os != 'Windows' }} | |
run: python .github/workflows/run-clang-format.py -r . | |
- name: Create env repo | |
shell: bash | |
run: | | |
# Save branch name | |
branch_name=$(git branch --show-current) | |
origine_branch_name="origin/${branch_name}" | |
echo current branch name is ${branch_name} | |
if [ `git ls-remote --heads https://github.com/Luos-io/luos_engine.git ${branch_name} | wc -l` ] | |
then | |
echo "Branch name ${branch_name} exists on luos_engine." | |
cd .. | |
git clone https://github.com/Luos-io/luos_engine.git | |
cd luos_engine | |
the_path=$(pwd) | |
echo "the pio lib path is ${{ matrix.pio_lib_path }}" | |
echo "luos_engine path is ${the_path}" | |
git checkout ${branch_name} | |
cd ../Get_started | |
echo "Get_started path is $(pwd)" | |
fi | |
- name: Run PlatformIO | |
env: | |
PLATFORMIO_LIB_EXTRA_DIRS: ${{ matrix.pio_lib_path }} | |
run: | | |
for dir in */; do | |
if [ -f "$dir/platformio.ini" ]; then | |
echo "Compiling: $dir" | |
platformio run -d "$dir" | |
fi | |
done |