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:
David Holdeman 2020-06-18 15:31:54 -07:00 committed by GitHub
parent a923b876f9
commit 6595d1d80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 2 deletions

View File

@ -112,6 +112,14 @@ jobs:
with:
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
- name: Download & Install GCC
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time

View File

@ -4,7 +4,6 @@ on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
@ -15,6 +14,14 @@ jobs:
with:
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
working-directory: ./simulator/
run: make -j4

View File

@ -4,7 +4,6 @@ on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
@ -12,6 +11,14 @@ jobs:
with:
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
working-directory: ./unit_tests/
run: make -j4

38
.github/workflows/gen-configs.yaml vendored Normal file
View File

@ -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 }}