weblate/.github/workflows/macos.yml
renovate[bot] 2700e7e2cf
chore(deps): update actions/checkout action to v7.0.1 (#20782)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-20 17:15:17 +00:00

99 lines
3.4 KiB
YAML
Vendored

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: macOS
on:
push:
branches-ignore:
- renovate/**
- weblate
- dependabot/**
- copilot/**
- codex/**
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
macos:
# This verifies that installation instructions works, any changes here
# need to be reflected in docs/admin/install/venv-macos.rst
runs-on: macos-26
env:
PYTHONUNBUFFERED: 1
PYTHONWARNINGS: default,ignore:unclosed:ResourceWarning
CI_REDIS_HOST: localhost
CI_DB_HOST: localhost
DJANGO_SETTINGS_MODULE: weblate.settings_test
CI_SKIP_SAML: 1
HOMEBREW_NO_AUTO_UPDATE: '1'
# renovate-homebrew-brew
HOMEBREW_BREW_REF: 3dd092c77e7a19316aae454b4116f01fda61693e
# renovate-homebrew-core
HOMEBREW_CORE_REF: 55cdf140129160c1d6b5c300bb99e8e8c329fe84
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Pin Homebrew snapshot
run: |
brew_repo="$(brew --repo)"
git -C "${brew_repo}" reset --hard
git -C "${brew_repo}" clean -fd
git -C "${brew_repo}" fetch --no-tags --depth=1 origin "${HOMEBREW_BREW_REF}"
git -C "${brew_repo}" checkout --force -B stable FETCH_HEAD
brew --version
brew tap --force homebrew/core
core_repo="$(brew --repo homebrew/core)"
git -C "${core_repo}" reset --hard
git -C "${core_repo}" clean -fd
git -C "${core_repo}" fetch --no-tags --depth=1 origin "${HOMEBREW_CORE_REF}"
git -C "${core_repo}" checkout --force --detach FETCH_HEAD
git -C "${core_repo}" rev-parse HEAD
echo "HOMEBREW_NO_INSTALL_FROM_API=1" >> "${GITHUB_ENV}"
- run: brew list --versions
- run: brew deps --tree --installed
- run: brew config
- run: brew doctor
continue-on-error: true
- name: Install brew dependencies
run: |
brew install python libyaml pkgconf zstd lz4 xxhash libxmlsec1 uv
- name: Install test dependencies
run: |
brew install icu4c valkey postgresql
brew link --force icu4c
- name: Start services
run: |
brew services start postgresql
brew services start valkey
- name: Install Weblate
run: |
uv venv .venv
source .venv/bin/activate
uv sync --frozen --all-extras --dev --no-binary-package lxml --no-binary-package xmlsec
- name: Test with Django
run: |
# shellcheck disable=SC2155
export CI_DB_USER="$(id -nu)"
source .venv/bin/activate
pytest --junitxml=junit.xml --cov=weblate --cov-report=xml --numprocesses=auto weblate
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{secrets.CODECOV_TOKEN}} # zizmor: ignore[secrets-outside-env]
flags: unittests
name: Tests macos
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env]
report_type: test_results