Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement VISA #28

Merged
merged 30 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
184618b
WIP: Use Protocol instead of Box<dyn Interface>
esarver Aug 9, 2024
6ced88a
Get VISA LAN working
esarver Aug 14, 2024
7d37d56
Get the Latest libvisa-stub to Link Against
esarver Aug 15, 2024
79961fc
See if this is where they put the releases
esarver Aug 19, 2024
c4526a5
Update package version and dependencies
esarver Aug 21, 2024
9ca920e
Run builds on platform specific runners
esarver Aug 21, 2024
f8c423f
Remove patch for kic-lib
esarver Aug 21, 2024
803a954
Use the proper runner
esarver Aug 21, 2024
a2e77b7
Setup Tools
esarver Aug 21, 2024
aaa89c7
Remove Unnecessary ls
esarver Aug 21, 2024
26011e3
Use container for package step
esarver Aug 21, 2024
e4547be
Get the VISA release for "Test" step
esarver Aug 21, 2024
10b6ee0
Correct the package name
esarver Aug 21, 2024
a6186f3
Remove quote from package name
esarver Aug 21, 2024
9813f42
Correct OS and CPU Details and make artifact names unique
esarver Aug 21, 2024
0d0ff28
Publish All Packages
esarver Aug 21, 2024
3fb6e79
Add visa stub library to package
esarver Aug 21, 2024
5ff35ba
Remove PDB file from bin
esarver Aug 21, 2024
b8c25b7
Add 'kic-visa' Executable and call into it if visa is installed
esarver Aug 22, 2024
fd78ea1
Remove patch in Cargo.toml
esarver Aug 22, 2024
3ecdff6
update kic-lib lock
esarver Aug 22, 2024
dfa91ee
Remove visa stub lib
esarver Aug 22, 2024
ad82359
Remove unused feature
esarver Aug 23, 2024
73332d4
Remove unused feature
esarver Aug 23, 2024
ece158a
Remove debugging line
esarver Aug 23, 2024
9a8c074
Update version number to 0.17.2
esarver Aug 23, 2024
6b56c27
Merge branch 'task/implement-visa' of https://github.com/tektronix/ts…
esarver Aug 23, 2024
e1f5cf4
Update CHANGELOG version
esarver Aug 23, 2024
a29a756
Fix npm Dependency issue
esarver Aug 23, 2024
864064c
Update kic-lib version
esarver Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 90 additions & 40 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Tool Versions
run: cargo fmt --version
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check Style
run: |
git config --global credential.helper store
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Tool Versions
run: cargo clippy --version
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Lint
run: |
git config --global credential.helper store
Expand All @@ -60,7 +60,7 @@ jobs:
password: ${{secrets.GITHUB_TOKEN}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Tools
run: |
npm ci --devDependencies
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Generate NPM BOM
run: npx @cyclonedx/cyclonedx-npm --output-format JSON --package-lock-only --output-reproducible --output-file npm.cdx.json
- name: Upload Results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: software-bom
path: |
Expand All @@ -88,7 +88,8 @@ jobs:
password: ${{secrets.GITHUB_TOKEN}}
env:
CARGO_HOME: ".cargo"
RUSTFLAGS: "-Cinstrument-coverage"
RUSTFLAGS: "-Cinstrument-coverage -L ./"
LIB_VISA_PATH: "${{github.workflow}}"
TEST_DIR: "test-results"
LLVM_PROFILE_FILE: "../test-results/%p-%m.profraw"
steps:
Expand All @@ -97,7 +98,13 @@ jobs:
cargo --version
grcov --version
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get Latest VISA Stub Release
uses: robinraju/release-downloader@v1
with:
repository: tektronix/libvisa-stub
latest: true
fileName: '*'
- name: Prebuild
run: |
git config --global credential.helper store
Expand All @@ -114,7 +121,7 @@ jobs:
cat ${{env.TEST_DIR}}/cargo_test.json | cargo2junit > ${{env.TEST_DIR}}/report.xml
grcov ${{env.TEST_DIR}} --binary-path target/debug -s . -o "${{env.TEST_DIR}}" --ignore-not-existing --ignore '.cargo/*' --output-types cobertura
- name: Upload Results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{always()}}
with:
name: unit-test-report
Expand All @@ -127,7 +134,7 @@ jobs:
needs: test
steps:
- name: Download Test Results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: unit-test-report
path: test-results
Expand Down Expand Up @@ -160,43 +167,74 @@ jobs:
name: Build
strategy:
matrix:
target_triple:
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
container:
image: ghcr.io/tektronix/tsp-toolkit-build:latest
credentials:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
include:
- runner: ubuntu-latest
triple: x86_64-unknown-linux-gnu
vscode-platform: linux-x64
- runner: windows-latest
triple: x86_64-pc-windows-msvc
vscode-platform: win32-x64
# - runner: macos-latest
# triple: x86_64-apple-darwin
# vscode-platform: darwin-arm64
runs-on: ${{matrix.runner}}
env:
RUSTFLAGS: "-L ${{github.workspace}}"
LIB_VISA_PATH: "${{github.workflow}}"
steps:
- name: Tool Setup
run: rustup update nightly && rustup default nightly
- name: Ensure Correct Target is Installed
run: rustup target add ${{matrix.triple}}
- name: Tool Versions
run: rustc --version
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get Latest VISA Stub Release
uses: robinraju/release-downloader@v1
with:
repository: tektronix/libvisa-stub
latest: true
fileName: '*'
- name: Build
run: |
git config --global credential.helper store
echo "https://${{vars.SERVICE_ACCOUNT_USER}}:${{secrets.SERVICE_ACCOUNT_PAT}}@github.com" > ~/.git-credentials
cargo build --target "${{matrix.target_triple}}" --release
cargo build --target "${{matrix.triple}}" --release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: executable
name: ${{matrix.vscode-platform}}-executable
path: |
target/${{matrix.target_triple}}/release/kic*
!target/${{matrix.target_triple}}/**/*.d
!target/${{matrix.target_triple}}/**/*.rlib
target/${{matrix.triple}}/release/kic*
!target/${{matrix.triple}}/**/*.d
!target/${{matrix.triple}}/**/*.rlib

package:
name: Package
runs-on: ubuntu-latest
needs: build
container:
image: ghcr.io/tektronix/tsp-toolkit-build:latest
credentials:
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
needs: build
strategy:
matrix:
include:
- runner: ubuntu-latest
triple: x86_64-unknown-linux-gnu
vscode-platform: linux-x64
os: linux
arch: x64
- runner: windows-latest
triple: x86_64-pc-windows-msvc
vscode-platform: win32-x64
os: win32
arch: x64
# - runner: macos-latest
# triple: x86_64-apple-darwin
# vscode-platform: darwin-arm64
steps:
- name: Update ClamAV
run: freshclam
Expand All @@ -205,15 +243,15 @@ jobs:
npm --version
clamscan -V
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
#set-safe-directory: "${{github.workspace}}"
fetch-depth: 0
fetch-tags: true
- name: Get Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: executable
name: ${{matrix.vscode-platform}}-executable
path: target/
- name: Get Tagged Version
id: lasttag
Expand Down Expand Up @@ -257,14 +295,22 @@ jobs:
run: |
mkdir -p bin
for f in target/*; do cp "$f" bin; done;

rm -f bin/*.pdb
- name: Run ClamAV
run: clamscan -v bin/*
- name: npm Package
run: npm pack
run: |
npm pkg set "name=$(npm pkg get name | tr -d '"')-${{matrix.vscode-platform}}" --verbose
npm pkg set "os[0]=${{matrix.os}}" --verbose
npm pkg set "cpu[0]=${{matrix.arch}}" --verbose
cat package.json
npm pack

- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: package
name: package-${{matrix.vscode-platform}}
path: ./*.tgz

publish:
Expand All @@ -289,20 +335,23 @@ jobs:
steps:
- name: Tool Versions
run: npm --version
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@tektronix'
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: package
pattern: package-*
merge-multiple: true
- name: publish package
run: |
npm publish *.tgz
for f in *.tgz; do
npm publish "$f"
done
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand All @@ -324,7 +373,7 @@ jobs:
if: ${{ endsWith(github.base_ref, 'main') && (contains(github.head_ref, 'release/') || github.event.pull_request.merged) }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
Expand Down Expand Up @@ -368,12 +417,13 @@ jobs:

- run: 'git tag --list ${V}*'
- name: Get Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: executable
pattern: "*-executable"
path: target
merge-multiple: true
- name: Get SBOM
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: software-bom
path: sbom
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
Security -- in case of vulnerabilities.
-->

## [0.17.1]

### Added

- VISA Support

## [0.17.0]

### Added
Expand Down Expand Up @@ -118,7 +124,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
- Feature to retrieve TSP-Link network details

<!--Version Comparison Links-->
[Unreleased]: https://github.com/tektronix/tsp-toolkit-kic-cli/compare/v0.17.0...HEAD
[Unreleased]: https://github.com/tektronix/tsp-toolkit-kic-cli/compare/v0.17.1...HEAD
[0.17.1]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.17.1
[0.17.0]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.17.0
[0.16.2]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.16.2
[0.16.1]: https://github.com/tektronix/tsp-toolkit-kic-cli/releases/tag/v0.16.1
Expand Down
Loading