Run gen scripts and unify firmware, simulator, and unit_tests workflows (#1506)
* add workflow and scripts * select current branch * added some comments * unify build workflows for firmware, testing, and simulator * move if to steps to keep from skipping * debug * Added comment * Move simulator and unit tests back to their own files * Move config and livedoc generation to its own file * Add gen configs workflow
This commit is contained in:
parent
a923b876f9
commit
6595d1d80e
|
@ -112,6 +112,14 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Generate Configs
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_config.sh
|
||||||
|
|
||||||
|
- name: Generate Live Documentation
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_live_documentation.sh
|
||||||
|
|
||||||
# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
|
# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
|
||||||
- name: Download & Install GCC
|
- name: Download & Install GCC
|
||||||
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time
|
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time
|
||||||
|
|
|
@ -4,7 +4,6 @@ on: [push,pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -15,6 +14,14 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Generate Configs
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_config.sh
|
||||||
|
|
||||||
|
- name: Generate Live Documentation
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_live_documentation.sh
|
||||||
|
|
||||||
- name: Build Simulator
|
- name: Build Simulator
|
||||||
working-directory: ./simulator/
|
working-directory: ./simulator/
|
||||||
run: make -j4
|
run: make -j4
|
||||||
|
|
|
@ -4,7 +4,6 @@ on: [push,pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -12,6 +11,14 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Generate Configs
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_config.sh
|
||||||
|
|
||||||
|
- name: Generate Live Documentation
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_live_documentation.sh
|
||||||
|
|
||||||
- name: Build Tests
|
- name: Build Tests
|
||||||
working-directory: ./unit_tests/
|
working-directory: ./unit_tests/
|
||||||
run: make -j4
|
run: make -j4
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
name: Generate configs and live docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Generate Configs
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_config.sh
|
||||||
|
|
||||||
|
- name: Generate Live Documentation
|
||||||
|
working-directory: ./firmware/
|
||||||
|
run: sh gen_live_documentation.sh
|
||||||
|
|
||||||
|
# Commit changes and catch the error that occurs if nothing has been changed (without catching other errors)
|
||||||
|
- name: Commit changes
|
||||||
|
run: |
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git config --local user.name "GitHub build-firmware Action"
|
||||||
|
git commit -am "Auto-generated configs and docs" 2>&1 | grep -E '(nothing to commit|changed)'
|
||||||
|
|
||||||
|
# We need to know what branch this is in order to push to the correct branch
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||||
|
id: extract_branch
|
||||||
|
|
||||||
|
- name: Push configs
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ github.token }}
|
||||||
|
branch: ${{ steps.extract_branch.outputs.branch }}
|
Loading…
Reference in New Issue