Skip to content

Commit

Permalink
chore: Add a scheduled workflow to run CI every day.
Browse files Browse the repository at this point in the history
This is to update ccache and other caches in the master branch.
Otherwise, only PRs build these and never share caches.

Also simplified the macOS deps building a bit. Qt does not depend on
anything in the deps, so we don't need to split it.
  • Loading branch information
iphydf committed Dec 23, 2024
1 parent 927b87d commit ee848a8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .ci-scripts/build-macos-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ install_deps \
build_ffmpeg.sh \
build_sqlcipher.sh \
build_hunspell.sh \
build_extra_cmake_modules.sh \
build_sonnet.sh \
build_toxcore.sh
14 changes: 0 additions & 14 deletions .ci-scripts/build-macos-qtdeps.sh

This file was deleted.

29 changes: 14 additions & 15 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build, test, and deploy

on:
# Run this workflow every day at 3:00 UTC to update caches.
schedule: [cron: '0 3 * * *']
pull_request:
branches: ["master"]
push:
Expand Down Expand Up @@ -35,7 +37,7 @@ jobs:

clang-tidy:
name: Clang-Tidy
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:

build-alpine:
name: Alpine
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -88,7 +90,7 @@ jobs:

build-alpine-static:
name: Alpine (static)
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -107,7 +109,7 @@ jobs:

build-debian:
name: Debian
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -127,7 +129,7 @@ jobs:

build-fedora:
name: Fedora with ASAN
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -147,7 +149,7 @@ jobs:

build-ubuntu:
name: Ubuntu LTS
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
runs-on: ubuntu-22.04
strategy:
matrix:
Expand Down Expand Up @@ -345,7 +347,7 @@ jobs:
with:
path: ".cache/ccache"
key: ${{ github.job }}-${{ matrix.arch }}-ccache
- name: Cache dependencies (except/requires Qt)
- name: Cache dependencies (except Qt)
id: cache-deps
uses: actions/cache@v4
with:
Expand All @@ -354,29 +356,26 @@ jobs:
.ci-scripts/dockerfiles/local-deps/include
.ci-scripts/dockerfiles/local-deps/lib
.ci-scripts/dockerfiles/local-deps/share
key: ${{ runner.os }}-${{ matrix.arch }}-local-deps
key: ${{ github.job }}-${{ matrix.arch }}-local-deps
- name: Cache dependencies (only Qt)
id: cache-qt
uses: actions/cache@v4
with:
path: |
.ci-scripts/dockerfiles/local-deps/qt
key: ${{ runner.os }}-${{ matrix.arch }}-qt
key: ${{ github.job }}-${{ matrix.arch }}-qt
- name: Homebrew dependencies to build dependencies
run: |
brew bundle --file ./macos/Brewfile-DepBuildDeps
sed -i '' -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=15/' "$(realpath "$(which create-dmg)")"
- name: Set up ccache
run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config
- name: Build dependencies (except Qt)
if: steps.cache-deps.outputs.cache-hit != 'true'
run: ./.ci-scripts/build-macos-deps.sh ${{ matrix.arch }}
- name: Build dependencies (only Qt)
if: steps.cache-qt.outputs.cache-hit != 'true'
run: ./.ci-scripts/build-macos-qt.sh ${{ matrix.arch }}
- name: Build dependencies (requires Qt)
- name: Build dependencies (except Qt)
if: steps.cache-deps.outputs.cache-hit != 'true'
run: ./.ci-scripts/build-macos-qtdeps.sh ${{ matrix.arch }}
run: ./.ci-scripts/build-macos-deps.sh ${{ matrix.arch }}
- name: Build qTox
run: ./.ci-scripts/build-qtox-macos.sh dist ${{ matrix.arch }}
- name: Upload dmg
Expand Down Expand Up @@ -436,7 +435,7 @@ jobs:

build-macos-user:
name: macOS user
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'schedule'
strategy:
matrix:
arch: [arm64, x86_64]
Expand Down

0 comments on commit ee848a8

Please sign in to comment.