name: Linux
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DOCKERFILE: picolibc/.github/Dockerfile
IMAGE_FILE: dockerimg-linux.tar.zst
IMAGE: picolibc-linux
PACKAGES_FILE: picolibc/.github/linux-packages.txt
EXTRA_FILE: picolibc/.github/linux-files.txt
jobs:
cache-maker:
runs-on: ubuntu-latest
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Cache the Docker Image
id: cache
uses: actions/cache@v5
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
tags: ${{ env.IMAGE }}:latest
outputs: type=docker,force-compression=true,compression=zstd,compression-level=22,dest=${{ env.IMAGE_FILE }}
cmake-linux:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
cmake_flags: [
"",
"-D__IO_FLOAT=y -D__IO_FLOAT_EXACT=n -D__IO_LONG_LONG=y -D_MB_CAPABLE=y -D_MB_EXTENDED_CHARSETS_ALL=y -D__IO_POS_ARGS=y -D_WANT_MINIMAL_IO_LONG_LONG=y -D_PRINTF_PERCENT_N=y",
]
test: [
"./.github/do-cmake-linux -DCMAKE_BUILD_TYPE=RelWithDebInfo",
"./.github/do-cmake-linux -DCMAKE_BUILD_TYPE=MinSizeRel",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: CMake test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.cmake_flags }}
minsize-linux-arm:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-arm",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Minsize test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype minsize
minsize-linux-riscv:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-riscv",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Minsize test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype minsize
minsize-linux-misc:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-misc",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Minsize test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype minsize
release-linux-arm:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-arm",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Release test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype release
release-linux-riscv:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-riscv",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Release test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype release
release-linux-misc:
needs: cache-maker
runs-on: ubuntu-latest
strategy:
matrix:
meson_flags: [
"",
"-Dio-float-exact=false -Dio-long-long=true -Dio-percent-b=true -Dio-long-double=true -Dnewlib-obsolete-math=false -Dwant-math-errno=true -Dsingle-thread=true -Dmb-capable=true -Dmb-extended-charsets=true -Dprintf-small-ultoa=true -Dprintf-percent-n=true",
"-Dformat-default=integer -Dfreestanding=true -Dnewlib-obsolete-math=true -Dwant-math-errno=true -Dassert-verbose=false -Dfast-bufio=true -Dstdio-locking=true -Dfstat-bufsiz=true",
]
test: [
"./.github/do-linux-misc",
]
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Restore the Docker Image
uses: actions/cache@v5
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
- name: Release test
run: |
docker run -v $(readlink -f picolibc):/picolibc -w /picolibc $IMAGE ${{ matrix.test }} ${{ matrix.meson_flags }} --buildtype release