-
Notifications
You must be signed in to change notification settings - Fork 429
56 lines (53 loc) · 2.25 KB
/
python-test-published-rc-package.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
# This routinely checks that the latest published -rc packages are installable
# and work properly. This makes sure that a new version of one of our
# dependencies is not breaking our releases.
# TODO: test more magika package versions
# TODO: check the actual predicted content types
name: Python - test published -rc packages
on:
schedule:
- cron: '42 3 * * *' # Run daily
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/python-test-published-rc-package.yml'
permissions:
contents: read
jobs:
unit-testing:
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # pin@v5
with:
python-version: '${{ matrix.python-version }}'
- if: matrix.os != 'windows-latest'
name: Install uv
run: curl -LsSf https://astral.sh/uv/0.5.4/install.sh | sh
- if: matrix.os != 'windows-latest'
name: Check that magika -rc can be installed with uv
run: mkdir /tmp/test-uv && cd /tmp/test-uv && uv init && uv add --prerelease allow magika && cd - && rm -rf /tmp/test-uv
- if: matrix.platform.runner == 'windows-latest'
name: Check that magika -rc install with uv works on Windows
shell: pwsh
run: |
mkdir C:\test-uv
Copy-Item -Path dist\*.whl -Destination C:\test-uv
cd C:\test-uv
uv init
$wheel = Get-ChildItem -Filter *.whl | Select-Object -ExpandProperty Name
uv add --prerelease ".\$wheel"
- name: Install magika with pip
run: python3 -m pip install --pre magika
- run: python3 -c 'import magika; m = magika.Magika(); print(m); print(magika.__version__)'
- run: magika --version
# The latest published model does not necessarily support detection for
# all types in our tests data; thus, for now we just check that the magika
# CLI does not crash when scanning the files, without checking the actual
# predictions.
- run: magika -r tests_data/basic