diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..ce4576457 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,48 @@ +name: WeasyPrint's tests +on: [push] + +jobs: + tests: + name: ${{ matrix.os }} - ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.6, 3.7, 3.8, pypy3] + exclude: + # Pillow wheel missing for this configuration + - os: macos-latest + python-version: pypy3 + # Cannot find installed libraries + - os: windows-latest + python-version: pypy3 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install DejaVu (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update -y && sudo apt-get install ttf-dejavu -y + - name: Install DejaVu, cairo, pango, gdk-pixbuf and libffi (MacOS) + if: matrix.os == 'macos-latest' + run: | + brew tap homebrew/cask-fonts + brew cask install font-dejavu + brew install cairo pango gdk-pixbuf libffi + - name: Install msys2 and DejaVu (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install -y --no-progress msys2 + powershell "C:\tools\msys64\usr\bin\bash -lc 'pacman -S mingw-w64-x86_64-ttf-dejavu mingw-w64-x86_64-gtk3 --noconfirm'" + xcopy "C:\tools\msys64\mingw64\share\fonts\TTF" "C:\Users\runneradmin\.fonts" /e /i + $env:PATH += ";C:\tools\msys64\mingw64\bin" + echo "::set-env name=PATH::$env:PATH" + - name: Upgrade pip and setuptools + run: python -m pip install --upgrade pip setuptools + - name: Upgrade cffi (Windows) + if: matrix.os == 'windows-latest' + run: python -m pip install --upgrade cffi + - name: Launch tests + run: python setup.py test --addopts="-v" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b2b771730..000000000 --- a/.travis.yml +++ /dev/null @@ -1,56 +0,0 @@ -language: python -env: PYTHON=python - -git: - submodules: false - -jobs: - include: - - dist: bionic - python: 3.6 - - dist: bionic - python: 3.7 - - dist: focal - python: 3.8 - - os: osx - language: generic - env: - - HOMEBREW_NO_AUTO_UPDATE=1 - - PYTHON=python3 - - os: windows - # Windows doesn't support python or even generic language - language: cpp - env: PYTHON=/c/Python38/python - allow_failures: - - os: windows - -addons: - apt: - packages: - - ttf-dejavu - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export "PATH=$PATH;C:\msys64\mingw64\bin"; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y python dejavufonts; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then wget "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20180531.tar.xz"; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z e msys2-base-x86_64-20180531.tar.xz; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then 7z x -y msys2-base-x86_64-20180531.tar -oc:\\; fi - # We need powershell because Travis' bash and MSYS2's bash rely on conflicting libraries - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell "C:\msys64\usr\bin\bash -lc 'pacman -S mingw-w64-x86_64-gtk3 --noconfirm'"; fi - - # Pango 1.38+ is needed to make @font-face work, remove these two lines when it's available on Travis - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p ~/.fonts; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget "https://github.com/Kozea/Ahem/blob/master/Ahem.ttf?raw=true" -O ~/.fonts/Ahem.ttf; fi - - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap homebrew/cask-fonts; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install font-dejavu; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cairo pango gdk-pixbuf libffi; fi - - # As setup.py doesn't use pip, setuptools is not updated before installing dependencies - - $PYTHON -m pip install --upgrade pip setuptools - - # Upgrade cffi to avoid errors while installing cairocffi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then $PYTHON -m pip install --upgrade cffi; fi - -script: - - $PYTHON setup.py test