Skip to content
Draft
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
52 changes: 39 additions & 13 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ jobs:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.cache-key }}
matrix-alpine: ${{ steps.alpine.outputs.matrix }}
matrix-ubuntu: ${{ steps.ubuntu.outputs.matrix }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Install packages
run: python3 -m pip install git+https://github.com/mesonbuild/meson
run: python3 -m pip install PyYAML git+https://github.com/mesonbuild/meson

- name: Calculate cache key
id: cache-key
Expand Down Expand Up @@ -59,18 +61,48 @@ jobs:
path: subprojects/packagecache
enableCrossOsArchive: true

- name: Build Ubuntu matrix
id: ubuntu
shell: python tools/filter_matrix.py {0}
run: |
- platform: aarch64
runner: ubuntu-24.04-arm
- platform: ppc64le
runner: ubuntu-24.04-ppc64le
selfhosted: true
- platform: s390x
runner: ubuntu-24.04-s390x
selfhosted: true
- platform: x86_64
runner: ubuntu-latest

- name: Build Alpine matrix
id: alpine
shell: python tools/filter_matrix.py {0}
run: |
- platform: aarch64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: ppc64le
runner: ubuntu-24.04-ppc64le
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/ppc64le/apk.static#!sha256!96ba92b49c8cc97fad06f0dfe3c50ec25c3344890e479999ded8752bf9e80d7f'
selfhosted: true
- platform: s390x
runner: ubuntu-24.04-s390x
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/s390x/apk.static#!sha256!368996f2908ec8f10f1de500bc97a9bd1c3b0b46ce0bd44983ac09862cbab6d5'
selfhosted: true
- platform: x86_64
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'

Ubuntu:
if: github.event_name != 'schedule' || github.repository == 'mesonbuild/wrapdb'
name: Ubuntu (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
needs: prelude
strategy:
matrix:
include:
- platform: aarch64
runner: ubuntu-24.04-arm
- platform: x86_64
runner: ubuntu-latest
include: ${{ fromJson(needs.prelude.outputs.matrix-ubuntu) }}
steps:
- uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -101,13 +133,7 @@ jobs:
needs: prelude
strategy:
matrix:
include:
- platform: aarch64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: x86_64
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
include: ${{ fromJson(needs.prelude.outputs.matrix-alpine) }}
steps:
- uses: jirutka/setup-alpine@v1
with:
Expand Down
79 changes: 52 additions & 27 deletions .github/workflows/sanity_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ jobs:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.cache-key }}
matrix-alpine: ${{ steps.alpine.outputs.matrix }}
matrix-ubuntu: ${{ steps.ubuntu.outputs.matrix }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Install packages
run: |
python3 -m pip install license-expression
python3 -m pip install license-expression PyYAML
python3 -m pip install --pre meson

- name: Calculate cache key
Expand Down Expand Up @@ -59,20 +61,61 @@ jobs:
run: |
./tools/fake_tty.py ./tools/sanity_checks.py

- name: Build Ubuntu matrix
id: ubuntu
shell: python tools/filter_matrix.py {0}
run: |
- platform: aarch64
runner: ubuntu-24.04-arm
python: 3.8
- platform: ppc64le
runner: ubuntu-24.04-ppc64le
python: 3.13
selfhosted: true
- platform: s390x
runner: ubuntu-24.04-s390x
python: 3.13
selfhosted: true
- platform: x86_64
runner: ubuntu-latest
python: 3.13

- name: Build Alpine matrix
id: alpine
shell: python tools/filter_matrix.py {0}
run: |
- platform: aarch64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: armv7
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: ppc64le
runner: ubuntu-24.04-ppc64le
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/ppc64le/apk.static#!sha256!96ba92b49c8cc97fad06f0dfe3c50ec25c3344890e479999ded8752bf9e80d7f'
selfhosted: true
- platform: riscv64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: s390x
runner: ubuntu-24.04-s390x
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/s390x/apk.static#!sha256!368996f2908ec8f10f1de500bc97a9bd1c3b0b46ce0bd44983ac09862cbab6d5'
selfhosted: true
- platform: x86
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
- platform: x86_64
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'

Ubuntu:
name: Ubuntu (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
needs: prelude
strategy:
fail-fast: false
matrix:
include:
- platform: aarch64
runner: ubuntu-24.04-arm
python: 3.8
- platform: x86_64
runner: ubuntu-latest
python: 3.13
include: ${{ fromJson(needs.prelude.outputs.matrix-ubuntu) }}
steps:
- uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -118,25 +161,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- platform: aarch64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: armv7
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: ppc64le
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: riscv64
runner: ubuntu-24.04-arm
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/aarch64/apk.static#!sha256!27a975638ddc95a411c9f17c63383e335da9edf6bb7de2281d950c291a11f878'
- platform: x86
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
- platform: x86_64
runner: ubuntu-latest
apk-tools-url: 'https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.7/x86_64/apk.static#!sha256!bdd044e0fd6cc388c5e571e1093efa5f35f7767cc5aa338b0a2576a429009a62'
include: ${{ fromJson(needs.prelude.outputs.matrix-alpine) }}
steps:
- uses: actions/checkout@v5
with:
Expand Down
34 changes: 34 additions & 0 deletions tools/filter_matrix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3

# Copyright 2025 Benjamin Gilbert <[email protected]>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# https://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import os
import sys
import yaml
import typing as T

UPSTREAM_OWNER = 'mesonbuild'

with open(sys.argv[1]) as f:
jobs: list[dict[str, T.Any]] = yaml.safe_load(f)

if os.environ['GITHUB_REPOSITORY_OWNER'] != UPSTREAM_OWNER:
jobs = [j for j in jobs if not j.get('selfhosted', False)]

with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('matrix=')
json.dump(jobs, f, separators=(',', ':'))
f.write('\n')
Loading