Skip to content

ci-build

ci-build #39

Workflow file for this run

name: ci-build
on:
schedule:
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
# This is meant to run at 13:17 UTC on 11th and 26th of every month
- cron: '17 13 11 * *'
- cron: '17 13 26 * *'
push:
branches:
- main
paths:
- '.github/actions/build-ci-image/**'
- '.github/actions/merge-ci-images/**'
- '.github/workflows/ci-build.yml'
- 'ci/build/**'
workflow_dispatch:
env:
# By default azurecr.io does not allow anynymous pulls. This has been enabled explicitly
# https://learn.microsoft.com/en-us/azure/container-registry/anonymous-pull-access
# Also see https://learn.microsoft.com/en-gb/azure/container-registry/
# and https://docs.docker.com/build/ci/github-actions/push-multi-registries/
REGISTRY_IMAGE_ROOT: libfn.azurecr.io/ci-build
jobs:
build:
if: ${{ github.repository == 'libfn/functional' }}
runs-on:
group: ${{ matrix.platform == 'linux/arm64' && 'runners-arm64' || 'runners-intel' }}
strategy:
fail-fast: false
matrix:
compiler:
- gcc:12
- gcc:13
- gcc:14
- gcc:15
- clang:16
- clang:17
- clang:18
- clang:19
- clang:20
platform:
- linux/amd64
- linux/arm64
steps:
- name: Prepare
run: |
compiler=${{ matrix.compiler }}
echo "COMPILER=${compiler%%:*}" >> $GITHUB_ENV
echo "RELEASE=${compiler##*:}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: ./.github/actions/build-ci-image
with:
platform: ${{ matrix.platform }}
image: ${{ env.REGISTRY_IMAGE_ROOT }}-${{ env.COMPILER }}
tags: |
type=raw,value=${{ env.RELEASE }}
type=sha,prefix=${{ env.RELEASE }}-sha-
registry: libfn.azurecr.io
username: ${{ secrets.AZURECR_NAME }}
password: ${{ secrets.AZURECR_PASS }}
build_args: |
GCC_RELEASE=${{ env.RELEASE }}
CLANG_RELEASE=${{ env.RELEASE }}
context: "ci/build/${{ env.COMPILER }}"
title: "build-${{ env.COMPILER}}-${{ env.RELEASE }}"
push: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
merge:
if: ${{ github.repository == 'libfn/functional' && github.ref_type == 'branch' && github.ref_name == 'main' }}
runs-on:
group: runners-intel
needs:
- build
strategy:
matrix:
compiler:
- gcc:12
- gcc:13
- gcc:14
- gcc:15
- clang:16
- clang:17
- clang:18
- clang:19
- clang:20
steps:
- name: Prepare
run: |
compiler=${{ matrix.compiler }}
echo "COMPILER=${compiler%%:*}" >> $GITHUB_ENV
echo "RELEASE=${compiler##*:}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: ./.github/actions/merge-ci-images
with:
image: ${{ env.REGISTRY_IMAGE_ROOT }}-${{ env.COMPILER }}
tags: |
type=raw,value=${{ env.RELEASE }}
type=sha,prefix=${{ env.RELEASE }}-sha-
registry: libfn.azurecr.io
username: ${{ secrets.AZURECR_NAME }}
password: ${{ secrets.AZURECR_PASS }}
title: "build-${{ env.COMPILER}}-${{ env.RELEASE }}"