Skip to content

release: Max updates 0.2.6 (#1449) #332

release: Max updates 0.2.6 (#1449)

release: Max updates 0.2.6 (#1449) #332

---
name: 🧪 Compiler - Build & Test (Alpine + LLVM 22)
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
build-test:
name: Build salam and run the test suite
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Build toolchain image (cached)
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: compiler
file: compiler/docker/Dockerfile
target: toolchain
tags: salam-toolchain:ci
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Cache ccache (docker build-test)
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning] ccache compiler cache, not a published runtime artifact
with:
path: .ccache
key: ccache-docker-${{ github.run_id }}
restore-keys: |
ccache-docker-
- name: Build and test
run: |
mkdir -p "${{ github.workspace }}/.ccache"
docker run --rm \
--network host \
-v "${{ github.workspace }}/compiler":/work \
-v "${{ github.workspace }}/.ccache":/ccache \
-e CCACHE_DIR=/ccache -e CCACHE_MAXSIZE=300M \
-w /work salam-toolchain:ci \
sh -c 'if command -v ccache >/dev/null 2>&1 || apk add --no-cache ccache 2>/dev/null; then CC="ccache cc"; else CC=cc; fi; \
make OUTDIR=. -j"$(nproc)" CC="$CC" && make OUTDIR=. test'