forked from picolibc/picolibc
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (153 loc) · 7.54 KB
/
zephyr.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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Zephyr
on:
push:
branches:
- main
pull_request:
branches:
- main
# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# .github/do-zephyr --buildtype release
# is the largest cache, 429.5M (September 2023).
CCACHE_SIZE: "450M"
CCACHE_CMD: ccache
DOCKERFILE: picolibc/.github/Dockerfile-zephyr
IMAGE_FILE: dockerimg-zephyr.tar.zst
IMAGE: picolibc
PACKAGES_FILE: picolibc/.github/zephyr-packages.txt
EXTRA_FILE: picolibc/.github/zephyr-files.txt
jobs:
cache-maker:
runs-on: ubuntu-latest
steps:
- name: Clone picolibc
uses: actions/checkout@v4
with:
path: picolibc
- name: Cache the Docker Image
id: cache
uses: actions/cache@v4
with:
path: ${{ env.IMAGE_FILE }}
key: ${{ env.IMAGE_FILE }}-${{ hashFiles( env.DOCKERFILE, env.PACKAGES_FILE, env.EXTRA_FILE ) }}
lookup-only: true
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@v3
- name: Build picolibc container
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
file: .github/Dockerfile-zephyr
tags: ${{ env.IMAGE }}:latest
outputs: type=docker,force-compression=true,compression=zstd,compression-level=22,dest=${{ env.IMAGE_FILE }}
minsize-zephyr:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
# Tinystdio and math configurations, one with multithread disabled and with locale, original malloc and atexit/onexit code
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dnewlib-multithread=false -Dnewlib-retargetable-locking=false -Dnewlib-locale-info=true -Dnewlib-locale-info-extended=true -Dnewlib-mb=true -Dnewlib-iconv-external-ccs=true -Dnewlib-nano-malloc=false -Dpicoexit=false -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dposix-io=false -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true",
# Original stdio, one with multithread disabled
"-Dtinystdio=false",
"-Dtinystdio=false -Dnewlib-io-float=true -Dio-long-long=true -Dio-long-double=true -Dnewlib-fvwrite-in-streamio=true -Dnewlib-multithread=false -Dnewlib-retargetable-locking=false",
]
test: [
"./.github/do-zephyr",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v4
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v4
with:
path: ${{ env.IMAGE_FILE }}
key: ${{ env.IMAGE_FILE }}-${{ hashFiles( env.DOCKERFILE, env.PACKAGES_FILE, env.EXTRA_FILE ) }}
fail-on-cache-miss: true
- name: Load and Check the Docker Image
run: |
docker load -i $IMAGE_FILE
docker images -a $IMAGE
# The docker image contains ccache, but the ccache action uses the ccache
# outside docker for statistics, so install the same ccache version.
# Install in /usr/bin so the ccache action gets the expected environment.
- name: install ccache
if: matrix.test == './.github/do-zephyr'
run: |
wget -nv https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2-linux-x86_64.tar.xz
sudo tar xf ccache-4.8.2-linux-x86_64.tar.xz -C /usr/bin --strip-components=1 --no-same-owner ccache-4.8.2-linux-x86_64/ccache
rm -f ccache-*-linux-x86_64.tar.xz
# Key on job name and cache size to get separate caches for linux
# and zephyr.
- name: ccache
if: matrix.test == './.github/do-zephyr'
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: compilation-${{ runner.os }}-${{ github.job }}-${{ matrix.meson_flags }}-${{ env.CCACHE_SIZE }}
max-size: ${{ env.CCACHE_SIZE }}
- name: Minsize test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc -v $GITHUB_WORKSPACE/.ccache:/root/.ccache $IMAGE bash --login -c "${{ env.CCACHE_CMD }} --set-config=max_size=${{ env.CCACHE_SIZE }} && ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype minsize"
release-zephyr:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
# Tinystdio and math configurations, one with multithread disabled and with locale, original malloc and atexit/onexit code
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dnewlib-multithread=false -Dnewlib-retargetable-locking=false -Dnewlib-locale-info=true -Dnewlib-locale-info-extended=true -Dnewlib-mb=true -Dnewlib-iconv-external-ccs=true -Dnewlib-nano-malloc=false -Dpicoexit=false -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dposix-io=false -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true",
# Original stdio, one with multithread disabled
"-Dtinystdio=false",
"-Dtinystdio=false -Dnewlib-io-float=true -Dio-long-long=true -Dio-long-double=true -Dnewlib-fvwrite-in-streamio=true -Dnewlib-multithread=false -Dnewlib-retargetable-locking=false",
]
test: [
"./.github/do-zephyr",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v4
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v4
with:
path: ${{ env.IMAGE_FILE }}
key: ${{ env.IMAGE_FILE }}-${{ hashFiles( env.DOCKERFILE, env.PACKAGES_FILE, env.EXTRA_FILE ) }}
fail-on-cache-miss: true
- name: Load and Check the Docker Image
run: |
docker load -i $IMAGE_FILE
docker images -a $IMAGE
# The docker image contains ccache, but the ccache action uses the ccache
# outside docker for statistics, so install the same ccache version.
# Install in /usr/bin so the ccache action gets the expected environment.
- name: install ccache
if: matrix.test == './.github/do-zephyr'
run: |
wget -nv https://github.com/ccache/ccache/releases/download/v4.8.2/ccache-4.8.2-linux-x86_64.tar.xz
sudo tar xf ccache-4.8.2-linux-x86_64.tar.xz -C /usr/bin --strip-components=1 --no-same-owner ccache-4.8.2-linux-x86_64/ccache
rm -f ccache-*-linux-x86_64.tar.xz
# Key on job name and cache size to get separate caches for linux
# and zephyr.
- name: ccache
if: matrix.test == './.github/do-zephyr'
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: compilation-${{ runner.os }}-${{ github.job }}-${{ matrix.meson_flags }}-${{ env.CCACHE_SIZE }}
max-size: ${{ env.CCACHE_SIZE }}
- name: Release test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc -v $GITHUB_WORKSPACE/.ccache:/root/.ccache $IMAGE bash --login -c "${{ env.CCACHE_CMD }} --set-config=max_size=${{ env.CCACHE_SIZE }} && ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype release"