Skip to content

Commit

Permalink
CI: Add windows and macos tests (#83)
Browse files Browse the repository at this point in the history
CI: Add windows and macos tests

This adds a job matrix for all operating systems.
Remove Docker testing components
Remove Docker-based github actions

---------

Co-authored-by: Gavin Medley <[email protected]>
  • Loading branch information
greglucas and medley56 authored Sep 30, 2024
1 parent 138a4bd commit 3bf1bf5
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 144 deletions.
6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

51 changes: 38 additions & 13 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
name: Run Style Checks and Test
on: pull_request
jobs:

pycodestyle:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Build Docker image
run: docker build . --file Dockerfile --target style --tag space-packet-parser-style:latest
- name: Run PyCodeStyle in Docker
run: docker run -i space-packet-parser-style:latest
- name: Install pycodestyle
run: pip install . pycodestyle
- name: Run pycodestyle
run: pycodestyle --config=pycodestyle.ini space_packet_parser

pylint:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Build Docker image
run: docker build . --file Dockerfile --target lint --tag space-packet-parser-lint:latest
- name: Run Pylint in Docker
run: docker run -i space-packet-parser-lint:latest
python-version-matrix:
- name: Install pylint
run: pip install . pylint
- name: Run pylint
run: pylint space_packet_parser

ci-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
uses: ./.github/workflows/test-python-version.yml
with:
python-version: ${{ matrix.python-version }}
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13-dev']
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
# We need the full history to generate the proper version number
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install . pytest pytest-randomly
- name: Testing
run: |
pytest --color=yes
19 changes: 0 additions & 19 deletions .github/workflows/test-python-version.yml

This file was deleted.

60 changes: 0 additions & 60 deletions Dockerfile

This file was deleted.

45 changes: 0 additions & 45 deletions docker-compose.yml

This file was deleted.

3 changes: 2 additions & 1 deletion space_packet_parser/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ def _print_progress(
percentage = "???"
progress = 0

elapsed_ns = time.time_ns() - start_time_ns
# Fast calls initially on Windows can result in a zero elapsed time
elapsed_ns = max(time.time_ns() - start_time_ns, 1)
delta = dt.timedelta(microseconds=elapsed_ns / 1E3)
kbps = int(current_bytes // 8 * 1E6 / elapsed_ns)
pps = int(current_packets * 1E9 / elapsed_ns)
Expand Down

0 comments on commit 3bf1bf5

Please sign in to comment.