From 0e8fee458e8f76a6273e0daaf8cc8b6a6eb33d62 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Sat, 26 Oct 2024 13:19:08 +1300 Subject: [PATCH] ci: Run macOS tests on m1 processor (#1141) * ci: Run macOS tests on m1 processor * ci: Install weasyprint with homebrew * test: Rename draft-miek-test.v3.xml The macOS tox tests in GHA gets confused this with the v3 converted file of the non v2 version. --- .github/workflows/checks.yml | 12 +++++++++--- Makefile | 2 +- ...draft-miek-test.v3.xml => draft-miek-test-v3.xml} | 0 tox.ini | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) rename tests/input/{draft-miek-test.v3.xml => draft-miek-test-v3.xml} (100%) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4c1456ec9..af5194751 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -97,7 +97,7 @@ jobs: tests-macos: name: Unit Tests (macOS) - runs-on: macos-12 + runs-on: macos-latest if: github.event_name == 'pull_request' strategy: @@ -131,7 +131,11 @@ jobs: - name: Install dependencies run: | - brew install pango pillow libffi groff make diffutils + brew install make diffutils + # Install WeasyPrint 61.2 + brew tap-new --no-git custom/weasyprint + brew extract --git-revision edb83fc7c8bb9987bdecb810e61281c5adc47c73 weasyprint custom/weasyprint + brew install weasyprint@61.2 echo "Installing pip + wheel..." python -m pip install --upgrade pip wheel echo "Installing requirements.txt + test dependencies..." @@ -139,6 +143,7 @@ jobs: - name: Generate Valid Tests run: | + export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_FALLBACK_LIBRARY_PATH echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH make yestests || true cp -af tests/out/. tests/valid @@ -147,8 +152,9 @@ jobs: env: PLATFORM: macos-latest run: | + export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_FALLBACK_LIBRARY_PATH echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH - tox + env 'TOX_OVERRIDE=testenv.pass_env+=DYLD_FALLBACK_LIBRARY_PATH' tox tests-windows: name: Unit Tests (Windows) diff --git a/Makefile b/Makefile index 1bf3ea118..2981b2a08 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ tests/out/%.v2v3.xml: tests/input/%.xml install @doc=$(basename $@); printf ' '; xmllint --noout --xinclude --relaxng xml2rfc/data/v3.rng $$doc.xml @PS4=" " /bin/bash -cx "xml2rfc --skip-config --allow-local-file-access --cache \"$${IETF_TEST_CACHE_PATH}\" --no-network --v2v3 --strict --legacy-date-format --add-xinclude $< --out $@" -tests/out/%.v3add-xinclude.xml: tests/input/draft-miek-test.v3.xml install +tests/out/%.v3add-xinclude.xml: tests/input/draft-miek-test-v3.xml install @PS4=" " /bin/bash -cx "xml2rfc --skip-config --allow-local-file-access --cache \"$${IETF_TEST_CACHE_PATH}\" --no-network --v2v3 --add-xinclude $< --out $@" tests/out/%.v3add-xinclude-w-revision.xml: tests/input/draft-template.xml install diff --git a/tests/input/draft-miek-test.v3.xml b/tests/input/draft-miek-test-v3.xml similarity index 100% rename from tests/input/draft-miek-test.v3.xml rename to tests/input/draft-miek-test-v3.xml diff --git a/tox.ini b/tox.ini index facaa6a1c..caede7a1e 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,8 @@ commands = allowlist_externals = make + diff + groff deps = pyflakes