-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (49 loc) · 1.74 KB
/
generate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Generate cantools
on:
workflow_dispatch:
push:
paths:
- "networks/**"
- ".github/**"
branches:
- master
jobs:
library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v3
name: Set up Python 3.10
with:
python-version: "3.10"
- name: Run cantools generator
run: |
pip install git+https://github.com/eagletrt/cantools.git
cantools generate_c_source --use-float --generate-dbc --infolder networks -o .
mkdir -p /tmp/workspace-evo
cp -R networks lib proto dbc /tmp/workspace-evo
- uses: actions/checkout@v2
with:
ref: build-evo
- name: Push generated includes
id: commit
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git rm -r --ignore-unmatch */*
rm -rf *
cp -r /tmp/workspace-evo/* .
git add .
if [[ $(git status --porcelain) ]]; then git commit -am "chore: automatically generated files" && git push; fi
echo "::set-output name=HASH::$(git rev-parse HEAD)"
- name: Send telegram message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
CAN was updated using cantools generator (branch build-evo)! 🔥
${{ github.actor }} created commit: ${{ github.event.commits[0].message }}
See changes: https://github.com/${{ github.repository }}/commit/${{steps.commit.outputs.HASH }}