mirror of
https://github.com/mandiant/capa.git
synced 2025-12-24 03:57:34 -08:00
I assume once we migrate to Python3, we want to support Python 3.6-9. Python 3.5 will stop receiving security fixes next month, so I don't think we need to support it. As running the test as many times as we want is free, run them for all supported versions to ensure capa work in all of them.
69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
code_style:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout capa
|
|
uses: actions/checkout@v2
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install dependencies
|
|
run: pip install 'isort==5.*' black
|
|
- name: Lint with isort
|
|
run: isort --profile black --length-sort --line-width 120 -c .
|
|
- name: Lint with black
|
|
run: black -l 120 --check .
|
|
|
|
rule_linter:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout capa with rules submodule
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
# We don't need vivisect, so we can install capa using Python3
|
|
- name: Install capa
|
|
run: pip install -e .
|
|
- name: Run rule linter
|
|
run: python scripts/lint.py rules/
|
|
|
|
tests:
|
|
name: Tests in ${{ matrix.python }}
|
|
runs-on: ubuntu-latest
|
|
needs: [code_style, rule_linter]
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- python: 2.7
|
|
- python: 3.6
|
|
- python: 3.7
|
|
- python: 3.8
|
|
- python: '3.9.0-alpha - 3.9.x' # Python latest
|
|
steps:
|
|
- name: Checkout capa with submodules
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Set up Python ${{ matrix.python }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- name: Install capa
|
|
run: pip install -e .[dev]
|
|
- name: Run tests
|
|
run: pytest tests/
|
|
|