forked from OpenSourceEBike/TSDZ2-Smart-EBike
-
Notifications
You must be signed in to change notification settings - Fork 34
87 lines (81 loc) · 2.54 KB
/
build.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
paths:
- ".github/workflows/build.yaml"
- "src/*"
pull_request:
paths:
- "src/*"
env:
SDCC_VERSION: 4.4.0
jobs:
Build_Windows:
runs-on: windows-latest
steps:
- name: install SDCC
run: | #install silent and then unpack missing installation libraries
Invoke-WebRequest -UserAgent "Wget" -Uri https://sourceforge.net/projects/sdcc/files/sdcc-win64/$env:SDCC_VERSION/sdcc-$env:SDCC_VERSION-rc3-x64-setup.exe/download -OutFile sdcc_setup.exe
ls
Start-Process -wait -FilePath "sdcc_setup.exe" -ArgumentList "/S", "/D=C:\Program Files\SDCC"
echo "Adding sdcc to PATH"
Add-Content $env:GITHUB_PATH "C:\Program Files\SDCC\bin"
- uses: actions/checkout@v4
- name: Build
run: |
cd src
../tools/cygwin_64/bin/make.exe clean
../tools/cygwin_64/bin/make.exe CFLAGS=--Werror
- uses: actions/upload-artifact@v4
with:
name: firmware_from_windows
path: bin/main.hex
Build_Linux:
runs-on: ubuntu-22.04
steps:
- name: install SDCC
run: |
cd ~
wget https://sourceforge.net/projects/sdcc/files/sdcc-linux-amd64/4.4.0/sdcc-4.4.0-amd64-unknown-linux2.5.tar.bz2/download -O sdcc-amd64.tar.bz2
ls
sudo tar xf sdcc-amd64.tar.bz2
cd sdcc-$SDCC_VERSION/
sudo cp -r * /usr/local
sdcc --version
sdcc --print-search-dirs
- uses: actions/checkout@v4
- name: Build
run: |
cd src
make clean
make CFLAGS=--Werror
- uses: actions/upload-artifact@v4
with:
name: firmware_from_linux
path: bin/main.hex
Compare_builds:
needs: [Build_Windows, Build_Linux]
runs-on: ubuntu-22.04
steps:
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: firmware_from_windows
path: firmware_from_windows
- name: Download Linux build
uses: actions/download-artifact@v4
with:
name: firmware_from_linux
path: firmware_from_linux
- name: Compare build files
run: |
ls
echo "Comparing build files"
git diff firmware_from_windows/main.hex firmware_from_linux/main.hex --word-diff=color --ignore-space-at-eol --exit-code
echo "Done comparing build files. Files are the same."