-
Notifications
You must be signed in to change notification settings - Fork 17
164 lines (143 loc) · 5.57 KB
/
sinfo.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: ingenic-sdk-sinfo
on:
workflow_dispatch:
env:
TAG_NAME: sinfo
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERM: linux
TZ: America/Los_Angeles
jobs:
build:
name: build-${{ matrix.target }}
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
container:
image: debian:bookworm
strategy:
fail-fast: false
matrix:
include:
- target: mango
chip: t10
- target: bull
chip: t20
- target: turkey
chip: t21
- target: pike
chip: t23
- target: monkey
chip: t30
- target: swan
chip: t31
- target: shark
chip: t40
- target: marmot
chip: t41
steps:
- name: Update package manager sources
run: |
apt-get update
- name: Install build dependencies
run: |
apt-get install -y --no-install-recommends --no-install-suggests 7zip build-essential bc ccache cpio curl ca-certificates file git gh jq make gawk lzop procps rsync tzdata u-boot-tools unzip
- name: Set timezone
run: |
ln -sf /usr/share/zoneinfo/${{ env.TZ }} /etc/localtime
echo ${{ env.TZ }} > /etc/timezone
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f noninteractive tzdata
- name: Setup gh workspace to container
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout repository source
uses: actions/checkout@v4
with:
ref: "master"
fetch-depth: "1"
- name: Setup cache directories
run: |
mkdir -p /github/home/.ccache
- name: Restore build cache
uses: actions/cache@v4
if: always()
with:
path: /github/home/.ccache
key: ${{ runner.os }}-ccache-${{ matrix.target }}-${{ github.sha }}-
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.target }}-${{ github.sha }}-
${{ runner.os }}-ccache-${{ matrix.target }}
${{ runner.os }}-ccache-
- name: Download toolchain
run: |
curl -L https://github.com/themactep/thingino-firmware/releases/download/toolchain/thingino-toolchain_xburst1_musl_gcc14-linux-mipsel.tar.gz -o ~/thingino-toolchain_xburst1_musl_gcc14-linux-mipsel.tar.gz
tar -xf ~/thingino-toolchain_xburst1_musl_gcc14-linux-mipsel.tar.gz -C ~/
~/mipsel-thingino-linux-musl_sdk-buildroot/relocate-sdk.sh
curl -L https://github.com/themactep/thingino-firmware/releases/download/toolchain/thingino-toolchain_xburst2_musl_gcc14-linux-mipsel.tar.gz -o ~/thingino-toolchain_xburst2_musl_gcc14-linux-mipsel.tar.gz
mkdir -p ~/temp_xburst2
tar -xf ~/thingino-toolchain_xburst2_musl_gcc14-linux-mipsel.tar.gz -C ~/temp_xburst2
mkdir -p ~/mipsel-thingino-linux-musl-xburst2_sdk-buildroot
mv ~/temp_xburst2/*/* ~/mipsel-thingino-linux-musl-xburst2_sdk-buildroot/
rm -rf ~/temp_xburst2
~/mipsel-thingino-linux-musl-xburst2_sdk-buildroot/relocate-sdk.sh
- name: Build
if: ${{ github.event.inputs.debug_enabled != 'true' }}
shell: bash
run: |
export CCACHE_DIR=/github/home/.ccache
export PATH="/usr/lib/ccache:$PATH"
# Set toolchain path based on target
if [ "${{ matrix.chip }}" = "t40" ]; then
export PATH="/github/home/mipsel-thingino-linux-musl-xburst2_sdk-buildroot/bin:$PATH"
else
export PATH="/github/home/mipsel-thingino-linux-musl_sdk-buildroot/bin:$PATH"
fi
ccache -M 4G
# Clone Linux repository
if [ "${{ matrix.chip }}" = "t40" ]; then
git clone --depth 1 https://github.com/gtxaspec/thingino-linux -b ingenic-t40 linux
elif [ "${{ matrix.chip }}" = "t41" ]; then
git clone --depth 1 https://github.com/gtxaspec/thingino-linux -b ingenic-t41-4.4.94 linux
else
git clone --depth 1 https://github.com/gtxaspec/thingino-linux -b ingenic-t31 linux
fi
# Build kernel
cd linux
make isvp_${{ matrix.target }}_defconfig
scripts/config --disable LOCALVERSION_AUTO
CROSS_COMPILE="ccache mipsel-linux-" make -j$(nproc) uImage
cd ..
# Build sinfo module
cd $GITHUB_WORKSPACE/sinfo
mkdir -p sinfo
mv sensor_info.c sinfo/sinfo.c
cd sinfo
echo "obj-m := sinfo.o" > Makefile
make -C $GITHUB_WORKSPACE/linux M=$PWD ARCH=mips CROSS_COMPILE="ccache mipsel-linux-" modules
# Copy built module with target suffix
cp sinfo.ko /tmp/sinfo-${{ matrix.chip }}.ko
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sinfo-${{ matrix.chip }}
path: /tmp/sinfo-${{ matrix.chip }}.ko
release:
needs: build
runs-on: ubuntu-24.04
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Release
uses: softprops/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}
files: |
./artifacts/sinfo-t10/sinfo-t10.ko
./artifacts/sinfo-t20/sinfo-t20.ko
./artifacts/sinfo-t21/sinfo-t21.ko
./artifacts/sinfo-t23/sinfo-t23.ko
./artifacts/sinfo-t30/sinfo-t30.ko
./artifacts/sinfo-t31/sinfo-t31.ko
./artifacts/sinfo-t40/sinfo-t40.ko
./artifacts/sinfo-t41/sinfo-t41.ko