-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (97 loc) · 4.11 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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 }}