Skip to content

Commit cba84fe

Browse files
ssantoluSalvador Santoluctio
andauthored
Temp branch (#5)
* Initial commit * fixing tests --------- Co-authored-by: Salvador Santoluctio <salvador.santolucito@ni.com>
1 parent 90f2f94 commit cba84fe

File tree

186 files changed

+789390
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+789390
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default code owner for labview-fpga-hdl-tools
2+
ssantolu #replace for \<reponame\>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### What does this Pull Request accomplish?
2+
3+
TODO: Include high-level description of the changes in this pull request.
4+
5+
### Why should this Pull Request be merged?
6+
7+
TODO: Justify why this contribution should be part of the project.
8+
9+
### What testing has been done?
10+
11+
TODO: Detail what testing has been done to ensure this submission meets requirements.

.github/workflows/CI.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
check_nitypes:
13+
name: Check nitypes
14+
uses: ./.github/workflows/check_nitypes.yml
15+
run_tests:
16+
name: Run tests
17+
uses: ./.github/workflows/run_tests.yml
18+
needs: []
19+
report_test_results:
20+
name: Report test results
21+
uses: ./.github/workflows/report_test_results.yml
22+
needs: []
23+
if: always()
24+
permissions:
25+
contents: read
26+
checks: write
27+
pull-requests: write

.github/workflows/PR.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
run_ci:
17+
name: Run CI
18+
uses: ./.github/workflows/CI.yml
19+
permissions:
20+
contents: read
21+
checks: write
22+
pull-requests: write
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check nitypes
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
check_nitypes:
9+
name: Check nitypes
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repo
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
- name: Set up Python
15+
uses: ni/python-actions/setup-python@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
16+
id: setup-python
17+
- name: Set up Poetry
18+
uses: ni/python-actions/setup-poetry@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
19+
- name: Check for lock changes
20+
run: poetry check --lock
21+
- name: Cache virtualenv
22+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
23+
with:
24+
path: .venv
25+
key: nitypes-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
26+
- name: Install nitypes
27+
run: poetry install -v
28+
- name: Lint
29+
run: poetry run ni-python-styleguide lint
30+
- name: Mypy static analysis (Linux)
31+
run: poetry run mypy
32+
- name: Mypy static analysis (Windows)
33+
run: poetry run mypy --platform win32
34+
- name: Bandit security checks
35+
run: poetry run bandit -c pyproject.toml -r src/nitypes
36+
- name: Add virtualenv to the path for pyright-action
37+
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
38+
- name: Pyright static analysis (Linux)
39+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
40+
with:
41+
python-platform: Linux
42+
version: PATH
43+
- name: Pyright static analysis (Windows)
44+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
45+
with:
46+
python-platform: Windows
47+
version: PATH

.github/workflows/publish.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Publish labview-fpga-hdl-tools
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
environment:
9+
description: The environment to publish to.
10+
default: 'none'
11+
required: true
12+
type: choice
13+
options:
14+
- none
15+
- pypi
16+
- testpypi
17+
18+
env:
19+
dist-artifact-name: labview-fpga-hdl-tools-distribution-packages
20+
environment: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }}
21+
environment-info: |
22+
{
23+
"pypi": {
24+
"base-url": "https://pypi.org",
25+
"upload-url": "https://upload.pypi.org/legacy/"
26+
},
27+
"testpypi": {
28+
"base-url": "https://test.pypi.org",
29+
"upload-url": "https://test.pypi.org/legacy/"
30+
}
31+
}
32+
33+
jobs:
34+
build_labview-fpga-hdl-tools:
35+
name: Build labview-fpga-hdl-tools
36+
runs-on: ubuntu-latest
37+
needs: []
38+
steps:
39+
- name: Check out repo
40+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41+
- name: Set up Python
42+
uses: ni/python-actions/setup-python@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
43+
- name: Set up Poetry
44+
uses: ni/python-actions/setup-poetry@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
45+
- name: Check project version
46+
if: github.event_name == 'release'
47+
uses: ni/python-actions/check-project-version@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
48+
- name: Build distribution packages
49+
run: poetry build
50+
- name: Upload build artifacts
51+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
52+
with:
53+
name: ${{ env.dist-artifact-name }}
54+
path: dist/*
55+
publish_to_pypi:
56+
name: Publish labview-fpga-hdl-tools to PyPI
57+
if: github.event_name == 'release' || inputs.environment != 'none'
58+
runs-on: ubuntu-latest
59+
needs: [build_labview-fpga-hdl-tools]
60+
environment:
61+
# This logic is duplicated because `name` doesn't support the `env` context.
62+
name: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }}
63+
url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/labview-fpga-hdl-tools
64+
permissions:
65+
id-token: write
66+
steps:
67+
- name: Download build artifacts
68+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
69+
with:
70+
name: ${{ env.dist-artifact-name }}
71+
path: dist/
72+
- run: ls -lR
73+
- name: Upload to ${{ env.environment }}
74+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
75+
with:
76+
repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }}
77+
update_version:
78+
name: Update labview-fpga-hdl-tools version
79+
runs-on: ubuntu-latest
80+
needs: [build_labview-fpga-hdl-tools]
81+
permissions:
82+
contents: write
83+
pull-requests: write
84+
steps:
85+
- name: Check out repo
86+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
87+
- name: Set up Python
88+
uses: ni/python-actions/setup-python@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
89+
- name: Set up Poetry
90+
uses: ni/python-actions/setup-poetry@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
91+
- name: Update project version
92+
uses: ni/python-actions/update-project-version@f0276f7f58868ec0d0d1a86377287c9e6fe0c6e7 # v0.5.0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Report test results
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
report_test_results:
9+
name: Report test results
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
checks: write
14+
pull-requests: write
15+
steps:
16+
- name: Check out repo
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
- name: Download test results
19+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
20+
with:
21+
path: test_results
22+
pattern: test_results_*
23+
merge-multiple: true
24+
- name: List downloaded files
25+
run: ls -lR
26+
- name: Publish test results
27+
uses: EnricoMi/publish-unit-test-result-action@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0
28+
with:
29+
files: "test_results/**/*.xml"
30+
if: always()

.github/workflows/run_tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Run Test Workflow
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
test:
9+
name: Run Test Workflow
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [windows-latest]
14+
python-version: [3.9]
15+
fail-fast: false
16+
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -e .
30+
pip install pytest pytest-cov
31+
pip install click
32+
pip install mako
33+
34+
- name: Run test workflow
35+
run: python tests/test_workflow.py
36+
shell: bash

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
4+
# Unit tests
5+
.tox/
6+
test_results/
7+
.benchmarks/
8+
9+
# Coverage output
10+
.coverage
11+
htmlcov/
12+
13+
# Environments
14+
.env
15+
.venv
16+
17+
# Built artifacts
18+
dist/
19+
docs/_build/
20+
21+
# Common editor metadata
22+
.vscode/
23+
24+
# Office temporary files
25+
~*.pptx
26+
~*.xlsx
27+
~*.docx

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Contributing to labview-fpga-hdl-tools
2+
3+
Contributions to labview-fpga-hdl-tools are welcome from all!
4+
5+
labview-fpga-hdl-tools is managed via [git](https://git-scm.com), with the canonical upstream
6+
repository hosted on [GitHub](https://github.com/ni/<reponame>/).
7+
8+
labview-fpga-hdl-tools follows a pull-request model for development. If you wish to
9+
contribute, you will need to create a GitHub account, fork this project, push a
10+
branch with your changes to your project, and then submit a pull request.
11+
12+
Please remember to sign off your commits (e.g., by using `git commit -s` if you
13+
are using the command line client). This amends your git commit message with a line
14+
of the form `Signed-off-by: Name Lastname <name.lastmail@emailaddress.com>`. Please
15+
include all authors of any given commit into the commit message with a
16+
`Signed-off-by` line. This indicates that you have read and signed the Developer
17+
Certificate of Origin (see below) and are able to legally submit your code to
18+
this repository.
19+
20+
See [GitHub's official documentation](https://help.github.com/articles/using-pull-requests/) for more details.
21+
22+
# Getting Started
23+
24+
- TODO: include build steps here.
25+
26+
# Testing
27+
28+
- TODO: include testing steps here.
29+
30+
# Developer Certificate of Origin (DCO)
31+
32+
Developer's Certificate of Origin 1.1
33+
34+
By making a contribution to this project, I certify that:
35+
36+
(a) The contribution was created in whole or in part by me and I
37+
have the right to submit it under the open source license
38+
indicated in the file; or
39+
40+
(b) The contribution is based upon previous work that, to the best
41+
of my knowledge, is covered under an appropriate open source
42+
license and I have the right under that license to submit that
43+
work with modifications, whether created in whole or in part
44+
by me, under the same open source license (unless I am
45+
permitted to submit under a different license), as indicated
46+
in the file; or
47+
48+
(c) The contribution was provided directly to me by some other
49+
person who certified (a), (b) or (c) and I have not modified
50+
it.
51+
52+
(d) I understand and agree that this project and the contribution
53+
are public and that a record of the contribution (including all
54+
personal information I submit with it, including my sign-off) is
55+
maintained indefinitely and may be redistributed consistent with
56+
this project or the open source license(s) involved.
57+
58+
(taken from [developercertificate.org](https://developercertificate.org/))
59+
60+
See [LICENSE](https://github.com/ni/<reponame>/blob/main/LICENSE)
61+
for details about how labview-fpga-hdl-tools is licensed.

0 commit comments

Comments
 (0)