Skip to content

Support parsing of node attributes in J2602 LDF file #370

Support parsing of node attributes in J2602 LDF file

Support parsing of node attributes in J2602 LDF file #370

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
paths-ignore:
- '*.md'
- '**/*.md'
- 'docs/**.*'
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
container:
image: python:${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: pip install -e .[dev]
- name: Test & Coverage
run: pytest -m 'unit or integration' --cov=ldfparser --cov-report xml
- name: Run Examples
if: always()
run: |
python ./examples/communication.py
python ./examples/ldf2json.py
python ./examples/read_comments.py
- name: Package
if: always()
run: python setup.py sdist bdist_wheel
- name: Upload coverage results
uses: codecov/codecov-action@v3
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./
flags: ${{ matrix.python-version }}
name: Python-${{ matrix.python-version }}
fail_ci_if_error: false
flake8:
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Install
run: pip install -e .[dev]
- name: Lint using Flake8
run: flake8 --count --show-source --statistics
pylint:
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: pip install -e .[dev]
- name: Lint using Pylint
run: pylint ldfparser --fail-under=8.5
pylint-tests:
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: pip install -e .[dev]
- name: Lint using Pylint
run: pylint tests --disable="C0114,C0116,R0201" --fail-under=8.0
snapshot-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout (current)
uses: actions/checkout@v4
with:
path: current
- name: Checkout (base)
uses: actions/checkout@v3
with:
path: base
ref: ${{ github.event.pull_request.base.ref }}
- name: Setup
run: pip install pytest
- name: Install base
working-directory: base
run: pip install -e .[dev]
- name: Generate snapshot data
working-directory: base
run: python tests/snapshot_data.py
- name: Move snapshot data
run: |
mkdir current/tests/snapshot/
mv base/tests/snapshot/* current/tests/snapshot/
- name: Install
working-directory: current
run: pip install -e .[dev]
- name: Snapshot test
working-directory: current
run: pytest -m 'snapshot'
performance-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: pip install -e .[dev]
- name: Run performance tests
run: pytest -m 'performance' --benchmark-json output.json
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container:
image: python:3.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: pip install -e .[dev]
- name: Package
run: python setup.py sdist bdist_wheel
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
- name: Get version from tag
id: tag_name
run: echo "::set-output name=current_version::${GITHUB_REF#refs/tags/v}"
- name: Read Changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.tag_name.outputs.current_version }}
path: CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.changelog.outputs.version }}
body: ${{ steps.changelog.outputs.changes }}