Skip to content

Commit

Permalink
feat(ci): run tests on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Feb 26, 2025
1 parent cd7730d commit 1e3cda9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ jobs:
env:
PYTHONUNBUFFERED: 1
PYTHONWARNINGS: default,ignore:unclosed:ResourceWarning
CI_DATABASE: postgresql
CI_REDIS_HOST: localhost
CI_DB_HOST: localhost
CI_SELENIUM: '1'
DJANGO_SETTINGS_MODULE: weblate.settings_test
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: astral-sh/setup-uv@v5.3.0
- run: brew update
- run: brew upgrade
- run: brew list --versions
Expand All @@ -33,9 +39,39 @@ jobs:
continue-on-error: true
- name: Install brew dependencies
run: |
brew install pango cairo gobject-introspection glib libyaml pkgconf zstd xxhash libxmlsec1 uv
brew install pango cairo gobject-introspection glib libyaml pkgconf zstd xxhash libxmlsec1 librsvg
- name: Install test dependencies
run: |
brew install mysql icu4c redis postgresql
brew link --force icu4c
- name: Start services
run: |
brew services start postgresql
brew services start redis
- name: Install Weblate
run: |
uv venv --python python3.12 .venv
source .venv/bin/activate
uv pip install -e ".[all]"
- name: Test with Django
run: |
# shellcheck disable=SC2155
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/icu4c/lib"
# shellcheck disable=SC2155
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/icu4c/include"
# shellcheck disable=SC2155
export PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:"$PKG_CONFIG_PATH"
# shellcheck disable=SC2155
export CI_DB_USER="$(id -nu)"
source .venv/bin/activate
uv run --no-sources --all-extras pytest --junitxml=junit.xml --cov=weblate --numprocesses=auto weblate
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: unittests
name: Tests macos
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@5c441a7bcc06f8706cde90192857d337c5dab8a6 # v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion docs/admin/install/venv-macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Installing on macOS

.. code-block:: sh
brew install python pango cairo gobject-introspection glib libyaml pkgconf zstd lz4 xxhash libxmlsec1 uv
brew install python pango cairo gobject-introspection glib libyaml pkgconf zstd lz4 xxhash libxmlsec1 librsvg uv
.. include:: steps/install-system-server.rst

Expand Down

0 comments on commit 1e3cda9

Please sign in to comment.