-
Notifications
You must be signed in to change notification settings - Fork 95
139 lines (117 loc) · 4.89 KB
/
Copy pathmacos.yml
File metadata and controls
139 lines (117 loc) · 4.89 KB
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
name: Build LVGL MicroPython for macOS arm64 (M1)
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 8 * * 1' # Monday morning — bitrot check for macOS
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-14 # 15 was giving a blank screen for some MacOS users
timeout-minutes: 120
outputs:
os-version: ${{ steps.version.outputs.OS_VERSION }}
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_ANALYTICS: 1
LDFLAGS: -L/opt/homebrew/opt/libffi/lib
CPPFLAGS: -I/opt/homebrew/opt/libffi/include
PKG_CONFIG_PATH: /opt/homebrew/opt/libffi/lib/pkgconfig
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPILERCHECK: content
CCACHE_NOHASHDIR: true
steps:
- name: Checkout repository with submodules
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Install dependencies via Homebrew
run: |
xcode-select --install || true # already installed on github
#brew install pkg-config libffi ninja make SDL2 error 404 on https://formulae.brew.sh/api/formula/sdl2.json
brew install pkg-config libffi ninja make sdl2-compat ccache
- name: Restore compiler cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .ccache
key: ccache-v1-${{ runner.os }}-${{ runner.arch }}-macos-arm64-${{ github.sha }}
restore-keys: |
ccache-v1-${{ runner.os }}-${{ runner.arch }}-macos-arm64-
- name: Configure compiler cache
run: |
echo "$(brew --prefix ccache)/libexec" >> "$GITHUB_PATH"
ccache --max-size 1G
ccache --zero-stats
- name: Show version numbers
run: |
xcodebuild -version
clang --version
- name: Extract OS version
id: version
run: |
OS_VERSION=$(grep "release = " internal_filesystem/lib/mpos/build_info.py | cut -d "=" -f 2 | cut -d "#" -f 1 | tr -d " " | tr -d '"')
echo "OS_VERSION=$OS_VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $OS_VERSION"
- name: Build LVGL MicroPython for macOS dev
run: |
./scripts/build_mpos.sh macOS
cp lvgl_micropython/build/lvgl_micropy_macOS lvgl_micropython/build/MicroPythonOS_arm64_macOS_${{ steps.version.outputs.OS_VERSION }}.bin
- name: Upload built binary as artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: MicroPythonOS_arm64_macOS_${{ steps.version.outputs.OS_VERSION }}.bin
path: lvgl_micropython/build/MicroPythonOS_arm64_macOS_${{ steps.version.outputs.OS_VERSION }}.bin
retention-days: 7
- name: Run syntax tests on macOS
run: |
./tests/syntax.sh
- name: Show compiler cache statistics
if: always()
run: ccache --show-stats
test:
needs: build
runs-on: macos-14
timeout-minutes: 180
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies via Homebrew
run: |
xcode-select --install || true
brew install pkg-config libffi ninja make sdl2-compat ccache
- name: Download built binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: MicroPythonOS_arm64_macOS_${{ needs.build.outputs.os-version }}.bin
- name: Install binary to expected path
run: |
mkdir -p lvgl_micropython/build
BIN=$(find . -name "MicroPythonOS_arm64_macOS_*.bin" | head -1)
cp "$BIN" lvgl_micropython/build/lvgl_micropy_macOS
chmod +x lvgl_micropython/build/lvgl_micropy_macOS
- name: Disable native/viper decorators
run: |
find -L internal_filesystem -name '*.py' -type f -print0 | while IFS= read -r -d '' f; do
if [ -L "$f" ]; then continue; fi
sed -i.bak -E 's/^([[:space:]]*)(@micropython\.(native|viper)[[:space:]]*)$/\1#\2/' "$f"
done
find -L internal_filesystem -name '*.py.bak' -type f -exec rm -f {} +
- name: Run unit tests on macOS
run: |
./scripts/test_runner.py
- name: Restore native/viper decorators
if: always()
run: |
find -L internal_filesystem -name '*.py' -type f -print0 | while IFS= read -r -d '' f; do
if [ -L "$f" ]; then continue; fi
sed -i.bak -E 's/^([[:space:]]*)#(@micropython\.(native|viper)[[:space:]]*)$/\1\2/' "$f"
done
find -L internal_filesystem -name '*.py.bak' -type f -exec rm -f {} +