Pulling in upstream pyang transform and allowing grouping/uses on sem… #117
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Copyright (c) 2020-2024 The Johns Hopkins University Applied Physics | |
## Laboratory LLC. | |
## | |
## This file is part of the AMM CODEC Engine (ACE) under the | |
## DTN Management Architecture (DTNMA) reference implementaton set from APL. | |
## | |
## Licensed under the Apache License, Version 2.0 (the "License"); | |
## you may not use this file except in compliance with the License. | |
## You may obtain a copy of the License at | |
## http://www.apache.org/licenses/LICENSE-2.0 | |
## Unless required by applicable law or agreed to in writing, software | |
## distributed under the License is distributed on an "AS IS" BASIS, | |
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
## See the License for the specific language governing permissions and | |
## limitations under the License. | |
## | |
## Portions of this work were performed for the Jet Propulsion Laboratory, | |
## California Institute of Technology, sponsored by the United States Government | |
## under the prime contract 80NM0018D0004 between the Caltech and NASA under | |
## subcontract 1658085. | |
## | |
name: Build and run unit tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10", "3.12"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: pip3 install build | |
- name: Build | |
run: python3 -m build | |
unit-test: | |
needs: [build] | |
runs-on: ubuntu-22.04 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10", "3.12"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: pip3 install '.[test]' | |
- name: Test | |
run: python3 -m pytest -v --cov=ace tests | |
flake8: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Prep | |
run: pip3 install -e '.[flake8]' | |
- name: Run flake8 | |
run: | | |
FAIL_SRC=0 | |
flake8 src || FAIL_SRC=$? | |
release: | |
needs: [unit-test, flake8] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: pip3 install build | |
- name: Build | |
run: python3 -m build | |
- name: Upload package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |