Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# docker build --build-arg BASE=alpine:3.21
ARG BASE=alpine:latest
FROM ${BASE}

RUN apk update
RUN apk add \
bash \
build-base \
cargo \
clang \
cmake \
curl \
file \
git \
icu \
linux-headers \
lsb-release-minimal \
mitmproxy \
moreutils \
perl \
powershell \
python3 \
python3-dev \
py3-pip \
sudo \
tar \
tree \
wget

RUN curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh | bash -eo pipefail /dev/stdin --channel 8.0 --install-dir /usr/share/dotnet
RUN ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

# https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-python.sh
COPY pip.conf /etc/pip.conf
ENV PIPX_BIN_DIR=/opt/pipx_bin
ENV PIPX_HOME=/opt/pipx
RUN python3 -m pip install pipx
RUN python3 -m pipx ensurepath
ENV PATH="PIPX_BIN_DIR:$PATH"
2 changes: 2 additions & 0 deletions .github/docker/alpine/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[global]
break-system-packages = true
38 changes: 14 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ jobs:
RUN_ANALYZER: code-checker,valgrind
- name: Linux (GCC + musl + libunwind)
os: ubuntu-latest
container: alpine:3.21
APK_PACKAGES: libunwind-dev libunwind-static
container: ghcr.io/getsentry/sentry-native-alpine:3.21
CMAKE_DEFINES: -DSENTRY_LIBUNWIND_SHARED=OFF
CC: gcc
CXX: g++
SYSTEM_PYTHON: 1
- name: Linux (clang + musl + libunwind)
os: ubuntu-latest
container: alpine:3.21
APK_PACKAGES: clang libunwind-dev libunwind-static
container: ghcr.io/getsentry/sentry-native-alpine:3.21
CMAKE_DEFINES: -DSENTRY_LIBUNWIND_SHARED=OFF
CC: clang
CXX: clang++
SYSTEM_PYTHON: 1
- name: macOS 14 (xcode llvm)
os: macos-14
ERROR_ON_WARNINGS: 1
Expand Down Expand Up @@ -162,23 +162,15 @@ jobs:
CMAKE_DEFINES: ${{ matrix.CMAKE_DEFINES }}
SYSTEM_VERSION_COMPAT: ${{ matrix.SYSTEM_VERSION_COMPAT }}
VS_GENERATOR_TOOLSET: ${{ matrix.VS_GENERATOR_TOOLSET }}
SYSTEM_PYTHON: ${{ matrix.SYSTEM_PYTHON }}

steps:
- name: Installing Alpine Linux Dependencies
if: ${{ contains(matrix.container, 'alpine') }}
run: |
apk update
apk add bash build-base cargo cmake curl curl-dev git icu linux-headers mitmproxy perl python3-dev sudo xz-dev ${{ matrix.APK_PACKAGES }}
curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh | bash -eo pipefail /dev/stdin --channel 8.0 --install-dir /usr/share/dotnet
ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
if: ${{ !matrix.container }}
with:
python-version: "3.11"
python-version: ${{ !env['SYSTEM_PYTHON'] && '3.11' || '' }}
cache: "pip"

- name: Installing Linux Dependencies
Expand Down Expand Up @@ -209,6 +201,12 @@ jobs:
sudo apt update
sudo apt install cmake gcc-9-multilib g++-9-multilib zlib1g-dev:i386 libssl-dev:i386 libcurl4-openssl-dev:i386

- name: Installing Alpine Linux Dependencies
if: ${{ contains(matrix.container, 'alpine') }}
run: |
apk update
apk add curl-dev libunwind-dev libunwind-static xz-dev

# https://github.com/actions/runner-images/issues/9491
- name: Decrease vm.mmap_rnd_bit to prevent ASLR ASAN issues
if: ${{ runner.os == 'Linux' && contains(env['RUN_ANALYZER'], 'asan') }}
Expand Down Expand Up @@ -273,19 +271,11 @@ jobs:
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
run: |
echo "127.0.0.1 sentry.native.test" | sudo tee -a /etc/hosts
# remove "::1 localhost ..." to avoid conflicts with proxy tests (musl)
sed '/^::1/d' /etc/hosts | sudo tee /etc/hosts
cat /etc/hosts
shell: bash

- name: Prepare env for Alpine Linux
if: ${{ contains(matrix.container, 'alpine') }}
run: |
apk add moreutils
# comment out "::1 localhost ..." to avoid conflicts with proxy tests
sed '/^::1/ s/^/#/' /etc/hosts | sponge /etc/hosts
python3 -m venv .venv --system-site-packages
source .venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV

- name: Test
shell: bash
run: |
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker

on:
push:
branches:
- master
paths:
- '.github/docker/**'
workflow_dispatch:

jobs:
alpine:
name: Build alpine:${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- '3.21'

permissions:
contents: read
packages: write

env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/sentry-native-alpine:${{ matrix.version }}

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build ${{ env.IMAGE_NAME }}
run: docker build --build-arg BASE=alpine:${{ matrix.version }} -t ${{ env.IMAGE_NAME }} .
working-directory: .github/docker/alpine

- name: Push ${{ env.IMAGE_NAME }}
run: docker push ${{ env.IMAGE_NAME }}
Loading