mirror of
https://github.com/google/magika.git
synced 2026-03-27 16:21:20 +00:00
49 lines
1.8 KiB
YAML
49 lines
1.8 KiB
YAML
# This routinely checks that published 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 packages
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "42 4 * * *" # Run daily
|
|
workflow_dispatch:
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/python-test-published-package.yml"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
UV_VERSION: "0.9.5"
|
|
|
|
jobs:
|
|
unit-testing:
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # pin@v4
|
|
- name: Setup Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # pin@v5
|
|
with:
|
|
python-version: "${{ matrix.python-version }}"
|
|
- name: Install uv
|
|
run: curl -LsSf https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh | sh
|
|
- name: Check that `uv add magika` works
|
|
shell: bash
|
|
run: mkdir /tmp/test-uv && cd /tmp/test-uv && uv init && uv add magika && cd - && rm -rf /tmp/test-uv
|
|
- name: Install magika with pip
|
|
run: python3 -m pip install magika
|
|
- run: python3 -c 'import magika; m = magika.Magika(); print(m)'
|
|
- 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
|