mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
43b185e1c1
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
91 lines
2.6 KiB
YAML
91 lines
2.6 KiB
YAML
name: Test MinGW
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
mingw: ["MINGW32", "MINGW64"]
|
|
include:
|
|
- mingw: "MINGW32"
|
|
name: "MSYS2 MinGW 32-bit"
|
|
package: "mingw-w64-i686"
|
|
- mingw: "MINGW64"
|
|
name: "MSYS2 MinGW 64-bit"
|
|
package: "mingw-w64-x86_64"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash.exe --login -eo pipefail "{0}"
|
|
env:
|
|
MSYSTEM: ${{ matrix.mingw }}
|
|
CHERE_INVOKING: 1
|
|
|
|
timeout-minutes: 30
|
|
name: ${{ matrix.name }}
|
|
|
|
steps:
|
|
- name: Checkout Pillow
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up shell
|
|
run: echo "C:\msys64\usr\bin\" >> $env:GITHUB_PATH
|
|
shell: pwsh
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pacman -S --noconfirm \
|
|
${{ matrix.package }}-python3-cffi \
|
|
${{ matrix.package }}-python3-numpy \
|
|
${{ matrix.package }}-python3-olefile \
|
|
${{ matrix.package }}-python3-pip \
|
|
${{ matrix.package }}-python-pyqt6 \
|
|
${{ matrix.package }}-python3-setuptools \
|
|
${{ matrix.package }}-freetype \
|
|
${{ matrix.package }}-gcc \
|
|
${{ matrix.package }}-ghostscript \
|
|
${{ matrix.package }}-lcms2 \
|
|
${{ matrix.package }}-libimagequant \
|
|
${{ matrix.package }}-libjpeg-turbo \
|
|
${{ matrix.package }}-libraqm \
|
|
${{ matrix.package }}-libtiff \
|
|
${{ matrix.package }}-libwebp \
|
|
${{ matrix.package }}-openjpeg2 \
|
|
subversion
|
|
|
|
python3 -m pip install pyroma pytest pytest-cov pytest-timeout
|
|
|
|
pushd depends && ./install_extra_test_images.sh && popd
|
|
|
|
- name: Build Pillow
|
|
run: CFLAGS="-coverage" python3 -m pip install --global-option="build_ext" .
|
|
|
|
- name: Test Pillow
|
|
run: |
|
|
python3 selftest.py --installed
|
|
python3 -c "from PIL import Image"
|
|
python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests
|
|
|
|
- name: Upload coverage
|
|
run: |
|
|
python3 -m pip install codecov
|
|
bash <(curl -s https://codecov.io/bash) -F GHA_Windows
|
|
env:
|
|
CODECOV_NAME: ${{ matrix.name }}
|
|
|
|
success:
|
|
permissions:
|
|
contents: none
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
name: MinGW Test Successful
|
|
steps:
|
|
- name: Success
|
|
run: echo MinGW Test Successful
|