ci: build in a prebuilt Arch image with ccache and no QML cachegen
This commit is contained in:
1 parent
015626b65b
commit
18fafa01c5
3 files changed
+61
-8
No files matched your search
@@ -0,0 +1,31 @@
|
||||
name: CI image
|
||||
|
||||
# Builds the Arch image that ci.yml runs in, with the build dependencies preinstalled.
|
||||
# Rebuilt weekly to pick up Arch updates.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ['.gitea/ci-image/**', '.gitea/workflows/ci-image.yml']
|
||||
schedule:
|
||||
- cron: '0 3 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
image:
|
||||
# The build runs on the runner's own Docker daemon, so the amd64 runner has the new
|
||||
# image locally right away. It does not re-pull tags it already has.
|
||||
runs-on: amd64
|
||||
env:
|
||||
IMAGE: git.trivk.dev/tri/qtpotato-ci:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: docker build --pull -t "$IMAGE" .gitea/ci-image
|
||||
- name: Push
|
||||
run: |
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.trivk.dev -u "${{ github.actor }}" --password-stdin
|
||||
docker push "$IMAGE"
|
||||
+23
-8
@@ -3,24 +3,39 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore: ['README.md', 'LICENSES/**']
|
||||
pull_request:
|
||||
paths-ignore: ['README.md', 'LICENSES/**']
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||
runs-on: amd64
|
||||
container: archlinux:latest
|
||||
# Arch with the build dependencies preinstalled; see ci-image.yml.
|
||||
container: git.trivk.dev/tri/qtpotato-ci:latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
# Keep hits across weekly image rebuilds when the compiler did not change.
|
||||
CCACHE_COMPILERCHECK: content
|
||||
CCACHE_MAXSIZE: 500M
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm --needed git nodejs base-devel cmake ninja extra-cmake-modules \
|
||||
qt6-base qt6-declarative kirigami ki18n kcoreaddons kcrash kconfig \
|
||||
mpvqt qcoro qtkeychain-qt6 ffmpeg
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: .ccache
|
||||
key: ccache-${{ github.sha }}
|
||||
restore-keys: ccache-
|
||||
- name: Configure
|
||||
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
|
||||
# The tests do not load QML, so skip QML cachegen and debug info: they take over
|
||||
# half of the build. Release and AUR builds keep both.
|
||||
run: |
|
||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=-O0 \
|
||||
-DQT_QML_NO_CACHEGEN=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_TESTING=ON
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
run: |
|
||||
ccache -z
|
||||
cmake --build build
|
||||
ccache -s
|
||||
- name: Test
|
||||
env:
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
|
||||
Reference in new issue
Block a user