diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d1d5dd1ccd13..05c2fe2c9303 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 @@ -33,9 +39,35 @@ 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 + - 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: | + export LDFLAGS="${LDFLAGS} -L/usr/local/opt/icu4c/lib" + export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/icu4c/include" + export PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig:"$PKG_CONFIG_PATH" + 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 }}