Skip to content

Add badges and update coverage output in makefile #11

Add badges and update coverage output in makefile

Add badges and update coverage output in makefile #11

Workflow file for this run

name: Test
on: [push, pull_request, workflow_dispatch]
jobs:
test:
strategy:
matrix:
os:
- ubuntu
- macos
- windows
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
test-type:
- core
include:
- experimental: false
- python-version: "3.12"
experimental: true
continue-on-error: ${{ matrix.experimental }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
# Add system dependencies for macOS
# Add system dependencies for macOS
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install pkg-config glib gobject-introspection gtk+3
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=/opt/homebrew/lib:/usr/local/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
echo "GI_TYPELIB_PATH=/opt/homebrew/lib/girepository-1.0:/usr/local/lib/girepository-1.0:$GI_TYPELIB_PATH" >> $GITHUB_ENV
# Add system dependencies for Windows
- name: Install system dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
# Download and install MSYS2
$msys2Path = "C:\msys64"
if (-not (Test-Path $msys2Path)) {
choco install msys2 -y
}
# Add MSYS2 to PATH
$env:PATH = "$msys2Path\usr\bin;$msys2Path\mingw64\bin;$env:PATH"
# Update and install required packages
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syu'
C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gobject-introspection mingw-w64-x86_64-glib2 mingw-w64-x86_64-pkg-config'
# Set environment variables
echo "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "GI_TYPELIB_PATH=C:\msys64\mingw64\lib\girepository-1.0" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Set up Python ${{ matrix.python-version }}
uses: "./.github/actions/poetry_setup"
with:
python-version: ${{ matrix.python-version }}
python-allow-prereleases: ${{ matrix.experimental }}
poetry-version: "1.6.1"
cache-key: ${{ matrix.test-type }}
install-command: |
if [ "${{ matrix.test-type }}" == "core" ]; then
echo "Running core tests, installing dependencies with poetry..."
poetry install --only=main,dev
else
echo "Running extended tests, installing dependencies with poetry..."
poetry install --only=main,dev --all-extras
fi
- name: Run ${{matrix.test-type}} tests (Unix)
if: runner.os != 'Windows'
env:
PKG_CONFIG_PATH: /opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig:${{ env.PKG_CONFIG_PATH }}
DYLD_LIBRARY_PATH: /opt/homebrew/lib:/usr/local/lib:${{ env.DYLD_LIBRARY_PATH }}
GI_TYPELIB_PATH: /opt/homebrew/lib/girepository-1.0:/usr/local/lib/girepository-1.0:${{ env.GI_TYPELIB_PATH }}
run: |
if [ "${{ matrix.test-type }}" == "core" ]; then
make test
else
make extended_tests
fi
- name: Run ${{matrix.test-type}} tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
PATH: C:\msys64\mingw64\bin;C:\msys64\usr\bin;${{ env.PATH }}
PKG_CONFIG_PATH: C:\msys64\mingw64\lib\pkgconfig
GI_TYPELIB_PATH: C:\msys64\mingw64\lib\girepository-1.0
run: |
if ("${{ matrix.test-type }}" -eq "core") {
make test
} else {
make extended_tests
}
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}