mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
77 lines
2.2 KiB
YAML
77 lines
2.2 KiB
YAML
name: Build pipeline
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
jobs:
|
|
|
|
#Check the online status of the test PLCs first
|
|
check-plcs-online:
|
|
name: 'Test PLC online status'
|
|
runs-on: [self-hosted, linux, x64, womed-local-linux]
|
|
steps:
|
|
- name: 'Ping FPX-H-C30T'
|
|
run: ping 192.168.115.210 -w 5
|
|
- name: 'Ping FPX-H-C14R'
|
|
run: ping 192.168.115.212 -w 5
|
|
- name: 'Ping FPX-C30T'
|
|
run: ping 192.168.115.213 -w 5
|
|
|
|
#Run unit tests on the test PLCs
|
|
run-unit-tests:
|
|
name: 'Run unit tests'
|
|
needs: check-plcs-online
|
|
runs-on: [self-hosted, linux, x64, womed-local-linux]
|
|
strategy:
|
|
matrix:
|
|
dotnet-version: [ '6.0.x' ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: 'Setup dotnet ${{ matrix.dotnet-version }}'
|
|
uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: ${{ matrix.dotnet-version }}
|
|
- name: 'Run tests'
|
|
run: |
|
|
cd '${{ github.workspace }}/MewtocolTests'
|
|
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
|
|
#Upload to codecov
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
#Deplay package
|
|
publish-package:
|
|
name: 'Build and publish package'
|
|
needs: [run-unit-tests, ]
|
|
runs-on: [self-hosted, linux, x64, womed-local-linux]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: 6.0.x
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
run: dotnet build "MewtocolNet"
|
|
|
|
- name: Pack
|
|
run: dotnet pack "MewtocolNet"
|
|
|
|
- name: Publish
|
|
run: |
|
|
cd '${{ github.workspace }}/Builds'
|
|
dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/WOmed/index.json"
|
|
#dotnet nuget push "*.nupkg" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }} --source "https://api.nuget.org"
|