Skip to content

Sync CoralMicro

Sync CoralMicro #128

name: Sync CoralMicro
on:
push:
branches:
- master
schedule:
- cron: '0 14 * * *'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
submodules: recursive
- name: Check CoralMicro Changes
run: |
git submodule update --remote # Updates coralmicro if there has been a change.
git config --local user.name "Coral Bot"
git config --local user.email "[email protected]"
git add *
if [[ $(git status --porcelain | wc -l) == 0 ]]; then
echo "No changes detected."
echo "update=false" >> $GITHUB_ENV
else
echo "update=true" >> $GITHUB_ENV
git commit -m "Sync CoralMicro from upstream."
fi
- name: Build
if: env.update == 'true'
run: |
bash coralmicro/setup.sh
cmake -B build -S .
make -C build -j$(nproc)
rm -rf build
- name: Push Update
if: env.update == 'true'
uses: ad-m/github-push-action@4dcce6dea3e3c8187237fc86b7dfdc93e5aaae58
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main