Skip to content

make sure to restore log level after argument application #1259

make sure to restore log level after argument application

make sure to restore log level after argument application #1259

Workflow file for this run

name: tests
on:
push:
branches: [ master ]
tags-ignore: '**'
pull_request:
types: [opened, synchronize]
branches: [ master ]
jobs:
test:
runs-on: ${{ matrix.os }}
env:
MALSHARE_API: ${{ secrets.MALSHARE_API }}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
os: [windows-latest, macos-13, ubuntu-latest]
steps:
- name: Debug Logging
run: |
echo "event = ${{ github.event_name }}"
echo "action = ${{ github.event.action }}"
- name: Checkout Main Repository
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
- name: Clone PR Source Repository
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Linux-specific dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install xclip xvfb
- name: MacOS-specific dependencies
if: ${{ matrix.os == 'macos-13' }}
run: |
brew install libmagic
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
pip install .[all]
- name: Unit tests
if: ${{ matrix.os != 'ubuntu-latest' }}
run: |
python -m unittest discover -p test_*.py
- name: Unit tests
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
XDG_SESSION_TYPE=x11 xvfb-run python -m unittest discover -p test_*.py
coverage:
if: ${{ github.repository_owner == 'binref' }}
runs-on: ubuntu-latest
needs: test
env:
MALSHARE_API: ${{ secrets.MALSHARE_API }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
sudo apt-get install xclip xvfb
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
pip install .[all]
- name: Run tests and collect coverage
run: |
XDG_SESSION_TYPE=x11 xvfb-run pytest --cov-config=.coveragerc --cov refinery test/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: true