Simplify the CI tests using the Makefile

This commit is contained in:
Donncha Ó Cearbhaill
2024-09-30 12:39:21 +02:00
parent 5dfa0153ee
commit 69fb8c236f
7 changed files with 67 additions and 65 deletions

View File

@@ -1,16 +0,0 @@
name: Black
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check"

27
.github/workflows/mypy.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Mypy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
mypy_py3:
name: Mypy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Checkout
uses: actions/checkout@master
- name: Install Dependencies
run: |
pip install mypy
- name: mypy
run: |
make mypy

View File

@@ -1,19 +1,23 @@
name: Ruff
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push]
jobs:
ruff_py3:
name: Ruff syntax check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Checkout
uses: actions/checkout@master
- name: Install Dependencies
run: |
pip install --user ruff
pip install ruff
- name: ruff
run: |
ruff check --output-format github .
make ruff

29
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Run Python Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10'] # , '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
make install
make test-requirements
- name: Test with pytest
run: |
make test-ci

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env python3
# Mobile Verification Toolkit (MVT)
# Copyright (c) 2021-2022 Claudio Guarnieri.
# Use of this software is governed by the MVT License 1.1 that can be found at
# https://license.mvt.re/1.1/
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from mvt import android
android.cli()

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env python3
# Mobile Verification Toolkit (MVT)
# Copyright (c) 2021-2022 Claudio Guarnieri.
# Use of this software is governed by the MVT License 1.1 that can be found at
# https://license.mvt.re/1.1/
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from mvt import ios
ios.cli()

View File

@@ -1,14 +0,0 @@
#!/bin/sh -e
export SOURCE="mvt tests"
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
set -x
${PREFIX}autoflake --in-place --recursive --exclude venv ${SOURCE}
${PREFIX}isort ${SOURCE}
${PREFIX}black --exclude venv ${SOURCE}