Skip to content

[sources/ni] Added calculated timestamps based on NI box sampling rate to message format #1044

[sources/ni] Added calculated timestamps based on NI box sampling rate to message format

[sources/ni] Added calculated timestamps based on NI box sampling rate to message format #1044

Workflow file for this run

name: Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- name: Set up Python 3.11
uses: actions/setup-python@v5
id: setup_python
with:
python-version: 3.11
- name: Restore cached virtualenv
id: restore_virtualenv_cache
uses: actions/cache/restore@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/requirements.txt') }}
path: venv
- if: ${{ steps.restore_virtualenv_cache.outputs.cache-hit != 'true' }}
name: Cache pip dependencies
id: cache
uses: actions/cache@v4
env:
cache-name: cache-python-dependencies
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- if: ${{ steps.restore_virtualenv_cache.outputs.cache-hit != 'true' }}
name: Create virtualenv if not exists
shell: bash
run: |
python -m venv venv
- if: ${{ steps.restore_virtualenv_cache.outputs.cache-hit != 'true' }}
name: Install dependencies
shell: bash
run: |
source venv/Scripts/activate
python -m pip install --upgrade pip
pip install wheel
pip install flake8
pip install pytest-cov
pip install -r requirements.txt
pip install -e parsley
find sinks/ sources/ tools/ -name requirements.txt -type f -exec pip install -r {} \;
- if: ${{ steps.restore_virtualenv_cache.outputs.cache-hit != 'true' }}
name: Saved cached virtualenv
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/requirements.txt') }}
path: venv
- name: Lint with flake8
shell: bash
run: |
# stop the build if there are Python syntax errors or undefined names
# error codes shown by `--select` can be found
# here (F): https://flake8.pycqa.org/en/latest/user/error-codes.html
# and here (E): https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# flake8 config can be found in setup.cfg
flake8
- name: Test with pytest
shell: bash
run: |
source venv/Scripts/activate
flake8
- name: Test with pytest
shell: bash
run: |
source venv/Scripts/activate
pytest
- name: Enforce autopep8
shell: bash
run: |
source venv/Scripts/activate
autopep8 -d -r sources/ sinks/ omnibus/ tools/ *.py --exit-code