Skip to content

Merge pull request #16 from huskar-t/fix/disconnect #72

Merge pull request #16 from huskar-t/fix/disconnect

Merge pull request #16 from huskar-t/fix/disconnect #72

Workflow file for this run

name: OPC_DA_WIN
on:
push:
pull_request:
jobs:
test:
runs-on: windows-2022
strategy:
matrix:
go: [ '1.20' , 'stable' ]
arch: [ '386', 'amd64' ]
name: opc_test ${{ matrix.go }} - ${{ matrix.arch }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache-dependency-path: go.sum
- name: install core components
run: |
Start-BitsTransfer -Source https://github.com/huskar-t/opcdatest/releases/download/simulation/OPC.Core.Components.Redistributable.x64.3.00.108.msi
msiexec /norestart /i "OPC.Core.Components.Redistributable.x64.3.00.108.msi"
- name: Get absolute directory path
id: get_path
run: |
$absPath = "${{ github.workspace }}\.github\workflows\alias.xml"
Write-Host "Absolute directory path: $absPath"
echo "::set-output name=abs_path::$absPath"
- name: install da simulator
run: |
Start-BitsTransfer -Source https://github.com/huskar-t/opcdatest/releases/download/simulation/MatrikonOPCSimulation.exe
Start-Process -Wait -FilePath MatrikonOPCSimulation.exe -ArgumentList '/S' -PassThru
- name: start da simulator
run: |
$absPath = "${{ steps.get_path.outputs.abs_path }}"
reg add "HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\{F8582CF4-88FB-11D0-B850-00C0F0104305}\Options" /v DefaultConfig /t REG_SZ /d "$absPath" /f
reg add "HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\{F8582CF4-88FB-11D0-B850-00C0F0104305}\Options" /v LoadOnStartup /t REG_SZ /d "1" /f
sc.exe start "MatrikonOPC Server for Simulation and Testing"
- name: Test OPCDA
env:
GOARCH: ${{ matrix.arch }}
run: go test -v --count=1 -coverprofile='coverage.txt' -covermode=atomic ./...
- name: Upload coverage to Codecov
if: ${{ matrix.go }} == '1.20'
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}